Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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: – 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

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

Your Answer


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.