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?

  • 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

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.

  • 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 clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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