Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I want to do this so that gShutdown application can shutdown the system when I'm not there to enter a password. But I've read on forums that changing linux commands with chmod can cause problems in multi-user systems.

Can anyone explain why that might be?

share|improve this question
    
As a sidenote, you can use Shutdown GTimer which does not need to change any permissions: sourceforge.net/projects/shutdown-gtimer –  arrange Dec 30 '11 at 9:23
    
That looks great. I had tried gshutdown, but it can't actually shutdown at all by default. Thanks Jorge. –  TenLeftFingers Jan 1 '12 at 3:00
    
It's a great application and has worked flawlessly for me since installing. –  TenLeftFingers Jan 24 '12 at 21:37
add comment

1 Answer 1

Adding the setuid bit to the shutdown process will allow any process owned by any user ID to shutdown or restart the system with arbitrary delays.

While unlikely, it may also expose buffer overflows that allow unprivileged users to do more than this. With the setuid bit set, there is a possibility that the command can be invoked with input that causes the command to malfunction in a way useful to an attacker.

Even if you have a single user system, this can be a concern: if an attacker uses an exploit that allows them to run unprivileged code on your system, then setuid programs can provide a way to gain superuser privileges.

In contrast, the API used by the desktop provides much more limited actions (restart now, shutdown now, etc), and only allows unprivileged users to activate them in limited circumstances (user is an active local user, and there are no others logged into the system). If the application you're using has an option to use these APIs instead of directly invoking the shutdown command, that would be preferable.

share|improve this answer
    
Thanks James, I didn't realize there was that much involved - I need to read up on permissions! –  TenLeftFingers Jan 1 '12 at 2:59
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.