PDA

View Full Version : chown root:root dangers?


redchair
August 26th, 2006, 02:43 PM
Usually, if I download important files, I immediately use the command:

sudo chown root:root *

in the directory of the downloaded files to prevent changing by other programs. Things where this seems necessary is in the ~/.mozilla/plugins folder where I change the owner from a normal user account to root on the flash plugins after using the installer from Adobe.

Does this present a danger to the system, do executables that are owned by root automatically run with root privileges?

LKRaider
August 26th, 2006, 02:56 PM
Why change ownership to root?
There is no need to do that :\
What are you trying to accomplish with this?

Klaidas
August 26th, 2006, 03:38 PM
as long as "others" can't execute it, you're fine.

More info http://www.linux.org/lessons/beginner/l14/lesson14a.html

Randomskk
August 26th, 2006, 08:05 PM
Ownership is only changed to root if the SetUID bit is set.
By default, it's not, so any executable owned by root but without SetUID won't run as root.

"man chmod" for more info on SetUID and such.

redchair
September 2nd, 2006, 01:48 PM
Thanks for your helpful replies, especially about SetUID. I will have to read that built-in man page carefully. (I am changing ownership to root so that a normal person who sits down to my computer will not be able to change these files.)

LKRaider
September 2nd, 2006, 08:04 PM
The best way IMO would be to lock your screen when you leave, and if you want to share the pc with more people, create another user for them (even a general "guest" user would do fine - just don't add security-critical privileges to it then).

aysiu
September 2nd, 2006, 08:39 PM
If a file or directory is owned by root but has 777 privileges, it can be modified by anyone.

Ownership here isn't the issue--it's privileges.

I agree with LKRaider--set up a guest account for other users if you're that worried. There are various kiosk tools you can use, too, to restrict what the guest user can do. For KDE there's kiosktool. I believe there's something for Gnome as well that starts with an s--forget the actual name.