Thursday, July 30, 2009

Allowing other system users to run commands as user "root" without having to authenticate as root

I have an application (created by IBM Linux team) that controls all the buttons on my thinkpad and shows the changes visually (raise/lower the speaker volume, increase/decrease brightness ...etc). This application is called "tpb" and I found out that it cannot be run except by user root :(. Of course when I tried to put it in the session startup in my Ubuntu box - without adding sudo or gksudo before it - it never ran as expected and I really didn't want to enter the root password each time I run this nice app.

Anyway, I searched and found a method to allow me to run this tool using another user, but with the privileges of the owner (which is root in this case), you can simply do the following:

"chmod 6555 tpb"

This made me able to run it as any other application using my system user instead of root, and it ran like a charm :))

Source: http://www.unix.com/tips-tutorials/19060-unix-file-permissions.html

5 comments:

mhewedy said...

You mean that you just do "chmod 6555 tpb" this once, and after that you will be able to run this rooted-command as a non-root user ?

Ahmad Amr said...

That's exactly what I did, I just added "tpb -d" to my session startup ('-d' is only to make it run as a daemon) and it ran without having to authenticate as root.

mhewedy said...

I tried this with "mount" but couldn't make it work as with my non-root account.

I'll try this again.
BTY, thanks very much for your valuable information.

Is tpb is a free ? and how can i get it?

Ahmad Amr said...

I tried to do the same with NetworkManager as well, seems it doesn't run with all executables, I think especially with critical system commands, but I'm not quite sure. I'm glad you like the information I post and it's an honor that you called them "valuable" :), thanks. Concerning "tpb", it's inside IBM Intranet repositories and I don't think it's free, and even if it's free I guess it's created specifically for IBM Thinkpad laptops.

mhewedy said...

Thanks for your reply,

Really your information is very valuable at least for me.

I used to visit your blog to see your new posts that I really find them helpful and informative.

Thanks.