LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Mandriva (https://www.linuxquestions.org/questions/mandriva-30/)
-   -   Allowing all users to use 'shutdown' command (https://www.linuxquestions.org/questions/mandriva-30/allowing-all-users-to-use-shutdown-command-132420/)

mrde50garfield 01-07-2004 11:27 AM

Allowing all users to use 'shutdown' command
 
What modifications must I make to my Mandrake 9.1 server to allow all users the ability to run the 'shutdown' command?

The security level is set to 'standard'.

At this time, only root can execute this command.

colnago 01-07-2004 03:01 PM

shutdown is in /sbin, I think it is just not in the users path. The command is world executable, but most users do not have /sbin in their path. You could either just add /sbin to their path or put in an alias for shutdown to /sbin/shutdown for them.

Gary987 01-07-2004 04:07 PM

Why not just use halt?


Gary

ac_dispatcher 01-07-2004 11:13 PM

What about the sudo command? Not at home right now but you can give users access to su commands via sudo. Can't remember the exact name of the file but its in the /etc directory. I think it /etc/sudoers or something like that. I edited mine manually. you can as root -

#/usr/sbin/visudo


The syntax of the sudo line is:

user machine=(effective user) command

first column specifies the sudo user
next defines the hosts in which entry is valid
the 3rd ( ) column is the effective user that may run the commands, this allows to execute commands other than root.
finally the last is the commands given or allowed by sudo command

Some examples:

For example:

joe home.net=(ALL) ALL
-joe has root commands on home.net server

joe home.net=(mailman) ALL
-joe has mailman commands on home.net server

joe home.net=(bind) /usr/sbin/rndc,/usr/sbin/named
-joe has bind and can run above commands (mdc and named)

You could:

joe MDKserver=(ALL) /sbin/shutdown

replace joe with your user name and MDKserver with the server name.

OK to be honest its late and I may have made a mistake somewhere here. If I did please correct me :p

or
$sudo --help

ac_dispatcher 01-08-2004 03:51 AM

Try this also:
http://www.patoche.org/LTT/configuration/00000059.html

ryeman 01-08-2004 09:58 AM

If you want to 'shutdown' your computer, use halt :p . It works as root or user.


All times are GMT -5. The time now is 04:16 AM.