Quote:
Originally posted by FarAway
to run /sbin/init 0 or /sbin/shutdown -h now, i must be the root.
what command can i use if i wanna shut down as a user? is it permitted?
|
normally not by default, but you could solve it by using the command ´sudo´, this allows normal users to execute commands with root rights.
type (as root!) visudo and edit the file, e.g.:
[...]
Cmnd_Alias COMMAND1 = /sbin/shutdown
[...]
userX LOCAL=NOPASSWD: COMMAND1
[...]
now the user userX should be permitted to shutdown.
another solution could be:
-adding a new group (shutdown),
-modifying rights of /sbin/shutdown (chown root:shutdown /sbin/shutdown): chmod 4754 /sbin/shutdown
-setting setUID-Bit: chmod 4754 /sbin/shutdown
to allow ONLY users from shutdown group, otherwise EVERYONE could shutdown your box