Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
|
08-26-2002, 11:47 PM
|
#1
|
|
Member
Registered: Apr 2001
Location: Cheney, WA
Distribution: SuSE Linux Professional 9.2
Posts: 556
Rep:
|
Giving Specific users access to the reboot command
Dear All,
Sorry if this is in the wrong forum, it just seems like the most suitable place to ask this.
I am a single user of my own machine, and I would like to give myself access to the reboot command, tather than su ing then doing it ot just doing ctrl-alt-del. This is a learning experience and I would like the satisfaction of knowing how to do it.
I have already tries chown <username> /sbin/.reboot and chmod 777 /sbin/reboot to no avail. Can anyone please help?
Thanx beforehand
|
|
|
|
08-27-2002, 12:10 AM
|
#2
|
|
LQ Addict
Registered: Dec 2001
Location: Brooklyn, NY
Distribution: *NIX
Posts: 3,704
Rep:
|
You need to change permissions on /sbin/halt because /sbin/reboot is a symlink to halt
chmod 755 /sbin/halt should suffice
|
|
|
|
08-27-2002, 12:36 AM
|
#3
|
|
Member
Registered: Apr 2001
Location: Cheney, WA
Distribution: SuSE Linux Professional 9.2
Posts: 556
Original Poster
Rep:
|
tried but no
Nope. I did as u advised. First i exited the X server, and logged out completely. Logged in as root, and did a c
cd /sbin
chmod 755 halt
exit
then logged in as the regular user and typed in
reboot
and it said
must be superuser
Any ideas?
|
|
|
|
08-27-2002, 02:55 AM
|
#4
|
|
Moderator
Registered: May 2001
Posts: 24,813
|
It's either installing sudo, use PAM or try this:
open up /etc/inittab and look for the line where you CTRL+ALT+DEL, and add "-a" to shutdown args.
echo $LOGNAME >> /etc/shutdown.allow
now you're allowed to shutdown using the 3 finger salute.
If you're using PAM you can change the /etc/pam.d config for the shutdown service using allow lists. Add an "auth" line under the last auth statement w/o quotes: "auth required /lib/security/pam_listfile.so item=user sense=allow file=/etc/pam.d/shutdown.allow onerr=fail"
echo $LOGNAME >> /etc/pam.d/shutdown.allow.
Haven't tested the PAM solution for shutdown, but this works on other services so it should work with shutdown as well.
|
|
|
|
08-27-2002, 07:45 PM
|
#5
|
|
Member
Registered: Apr 2001
Location: Cheney, WA
Distribution: SuSE Linux Professional 9.2
Posts: 556
Original Poster
Rep:
|
unSpawn you kinda lost me. I do not with to shut down using ctr-alt-del. What I wish to do is simply allow a normal user, to use the reboot command without having to be root (superuser).
|
|
|
|
08-27-2002, 09:11 PM
|
#6
|
|
Moderator
Registered: May 2001
Posts: 24,813
|
Shutdown does what you ask it to do depending on the flag, "-h" for halt and "-r" for reboot, so...
|
|
|
|
08-27-2002, 09:29 PM
|
#7
|
|
Member
Registered: Apr 2001
Location: Cheney, WA
Distribution: SuSE Linux Professional 9.2
Posts: 556
Original Poster
Rep:
|
hmmm but how do i make a REGULAR user access the shutdown or even reboot commands?
|
|
|
|
08-27-2002, 10:17 PM
|
#8
|
|
LQ Addict
Registered: Dec 2001
Location: Brooklyn, NY
Distribution: *NIX
Posts: 3,704
Rep:
|
did you ignore /sbin/halt hint, or SuSE has different setup?
Also look at sudo
|
|
|
|
08-27-2002, 10:20 PM
|
#9
|
|
LQ Addict
Registered: Dec 2001
Location: Brooklyn, NY
Distribution: *NIX
Posts: 3,704
Rep:
|
Also what /etc/pam.d/halt looks like ?
|
|
|
|
08-27-2002, 11:18 PM
|
#10
|
|
Member
Registered: Apr 2001
Location: Cheney, WA
Distribution: SuSE Linux Professional 9.2
Posts: 556
Original Poster
Rep:
|
I quote myself
Quote:
Nope. I did as u advised. First i exited the X server, and logged out completely. Logged in as root, and did a c
cd /sbin
chmod 755 halt
exit
then logged in as the regular user and typed in
reboot
and it said
must be superuser
|
As for /etc/pam.d/halt, I will let you know as soon as I reboot to Linux. I'm running Winblows at the moment
|
|
|
|
08-28-2002, 07:15 AM
|
#11
|
|
Member
Registered: May 2002
Location: London
Distribution: Debian
Posts: 388
Rep:
|
man sudo
Regards
|
|
|
|
08-28-2002, 12:30 PM
|
#12
|
|
Member
Registered: Mar 2002
Distribution: Mandrake 8.1
Posts: 386
Rep:
|
Check the man page on "shutdown" for /etc/shutdown.allow.
|
|
|
|
03-23-2004, 07:27 PM
|
#13
|
|
LQ Newbie
Registered: Mar 2004
Distribution: Slackware
Posts: 3
Rep:
|
THE answer!!!
Hey, stop confusing this guy with the wrong answers!! i saw this post yesterday cuz I had the same issue and I found the solution!!
man sudoers
actually just go to /etc and edit sudoers. at the end of the file there should be 3 commented out lines to the tune of 'examples' and two examples beneath. change one to say (don't quote me on the syntax)
$:users allow:/sbin/shutdown -h now NOPASSWD:ALL
like i said look up 'man sudoers' to get the syntax right if my memory is wrong  also to reboot just duplicate the line and replace '-h' with '-r'
you shouldn't have to even check the man pages if you're astute enough!!
BTW halt and reboot can only be run in runlevel 1 and 6, if they are called in ANY other runlevel it tels the system ./sbin/shutdown -h now
freakin lamerz
|
|
|
|
03-23-2004, 08:27 PM
|
#14
|
|
LQ Veteran
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,756
|
Um, you answered a thread that is a year and a half old. I think they moved on.
|
|
|
|
03-24-2004, 04:11 PM
|
#15
|
|
LQ Newbie
Registered: Mar 2004
Distribution: Slackware
Posts: 3
Rep:
|
whateva
it's my hot body, i'll do what i want
um.. for the benefit of others.
i'm sick of round about answers on web forms. so i took matters into my own hands. besides, if it's so damn old... WTF!! why are you replying to me?
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 04:03 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|