LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
LinkBack Search this Thread
Old 06-01-2005, 03:25 PM   #1
LinuxSeeker
Member
 
Registered: Feb 2004
Location: Linuxland
Distribution: Ubuntu 5.10, KUbuntu 5.10, Mandrake 10.1 - Ubuntu 5.04 (Hoary)
Posts: 346

Rep: Reputation: 30
How can I make the "shutdown" command available for all users?


I know that using GUI is a very easy way to do it, but I want to allow all users to access this command from the command line. What should I do? I guess I will have to copy the "shutdown" from /sbin to /bin but how can I make this copy executable for all users (or better for a specific user)? Maybe by using the chmod command but I don't know how exactly...

Can someone please help me?
 
Old 06-01-2005, 03:41 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,950
Blog Entries: 11

Rep: Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860
chmod u+s /sbin/halt
ln -s /sbin/halt /bin/halt


Cheers,
Tink
 
Old 06-01-2005, 04:31 PM   #3
LinuxSeeker
Member
 
Registered: Feb 2004
Location: Linuxland
Distribution: Ubuntu 5.10, KUbuntu 5.10, Mandrake 10.1 - Ubuntu 5.04 (Hoary)
Posts: 346

Original Poster
Rep: Reputation: 30
Thanks, that should work for all users but what if I want to give execute permissions to a specific user (for example usertest)?

I tried "chmod usertest +x /sbin/shutdown" but I get the error "chmod: invalid mode string: `usertest'

what now?

Thanks in advance
 
Old 06-01-2005, 04:36 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,950
Blog Entries: 11

Rep: Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860
That won't work ... what you can do alternatively is
to
e.g.
groupadd shutdown
usermod -g shutdown usertest
chgrp shutdown /sbin/halt


Cheers,
Tink
 
Old 06-01-2005, 04:52 PM   #5
LinuxSeeker
Member
 
Registered: Feb 2004
Location: Linuxland
Distribution: Ubuntu 5.10, KUbuntu 5.10, Mandrake 10.1 - Ubuntu 5.04 (Hoary)
Posts: 346

Original Poster
Rep: Reputation: 30
Nope, it doesnt work... A message says "shutdown: must be root to do that"

Can I do something like what I described above, to give extra rights to a user without adding him to a group?
 
Old 06-01-2005, 05:06 PM   #6
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,950
Blog Entries: 11

Rep: Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860
Odd - works fine here.

Show's the output of
ls -l `which halt`?

And no, you can't.


Cheers,
Tink
 
Old 06-01-2005, 05:12 PM   #7
LinuxSeeker
Member
 
Registered: Feb 2004
Location: Linuxland
Distribution: Ubuntu 5.10, KUbuntu 5.10, Mandrake 10.1 - Ubuntu 5.04 (Hoary)
Posts: 346

Original Poster
Rep: Reputation: 30
Maybe I get this error message due to the fact that I use "shutdown" instead of halt...

I typed the previous commands as follows:

groupadd advanced
usermod -g advanced usertest
chgrp advanced /sbin/shutdown

But I keep getting the same error...
 
Old 06-01-2005, 05:40 PM   #8
Wynd
Member
 
Registered: Jul 2001
Distribution: Slackware 12
Posts: 511

Rep: Reputation: 32
Try using sudo. It lets you give other users root permissions for whichever commands you choose, by typing (for example) "sudo halt".

http://www.courtesan.com/sudo/
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
So many errors when I typed the "make" and "make install" command Niceman2005 Linux - Software 23 07-22-2009 02:33 PM
error on "make"command; ralink 2500 driver jimbrook Linux - Wireless Networking 2 05-23-2005 10:58 PM
"adduser" not adding users to default group "users" PunkPT Slackware 2 09-23-2004 11:50 AM
How to install "make" command from rpm on cd 2 - red hat linux 7.0 ZARGON Linux - Newbie 2 08-31-2004 10:53 AM
'Last' command showing "Crash" for ftp users wizade Linux - Software 2 10-27-2003 12:48 PM


All times are GMT -5. The time now is 07:57 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration