LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   how to share a command with other users? (https://www.linuxquestions.org/questions/slackware-14/how-to-share-a-command-with-other-users-116657/)

Kjetil4455 11-16-2003 09:43 AM

how to share a command with other users?
 
I want my other user to be able to shutdown without having to do the "su -" command all the time. is that possible?

kilgoretrout 11-16-2003 07:39 PM

As root run:

# chmod 755 /sbin/shutdown

Then an ordinary user should be able to shutdown with:

$ /sbin/shutdown -h now

Or if they don't want to type the "sbin" first, create a link in /usr/bin to it like so:

# ln -s /sbin/shutdown /usr/bin/shutdown

Then all they need to do is run:

$ shutdown -h now

Lagg 11-16-2003 09:21 PM

my answer........ stolen!

note: I like to use "telinit 0" instead if /sbin/shutdown.


(does same thing).

Noryungi 11-17-2003 09:19 AM

Configure the one command ("shutdown") in the file "/etc/sudoers" for every user. This way, your users will be able to access this command through sudo without knowing the root password and without modifying the rights to the binary. This has several advantages.

Check the following for more information on how to do this:
http://www.onlamp.com/pub/a/bsd/2002...y_Daemons.html
http://www.onlamp.com/pub/a/bsd/2002...y_Daemons.html

(these two are for FreeBSD, but Slackware is almost the same)


All times are GMT -5. The time now is 10:57 PM.