-
March 31st, 2003, 07:13 PM
#1
Member
Question regarding linux shutdown
Can ny1 explain why an ordinary user can shutdown the system in GUI, but cannot do the same from command line
-
March 31st, 2003, 07:29 PM
#2
what flavor (distro) of Linux are you using?
on my system, only admin accounts can shutdown...
yeah, I\'m gonna need that by friday...
-
March 31st, 2003, 07:47 PM
#3
I've seen this on redhat i believe.. kinda scary.. I was in a hurry at the time so i didn't explore why or how to stop it, but maybe i'll get some time to experiment..
-
March 31st, 2003, 08:31 PM
#4
Member
If you are referring to RedHat 8 (which is what I use), you can disable that option by going to control center -> system -> login manager
Then you switch to administrator mode which requires the root password and click on the tab that says Sessions. Here you can choose to only allow root to shutdown and reboot or (the default) to allow everyone.
I think that is written to the file /etc/X11/xdm/kdmrc but this is the gui route to do what you are looking for.
----
dAggressor
dAggressor
It\'s a long life, until you die
-
April 1st, 2003, 04:29 AM
#5
Junior Member
This is likely because the shutdown command is not in your path.
The path to the shutdown is usually:
/sbin/shutdown
For example a regular user on my system (Mandrake 9.0) has the following PATH:
/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/usr/games:/home/ken/bin
Check your PATH by running thr following command:
echo $PATH
-
April 1st, 2003, 07:25 AM
#6
Member
StormCr0w true sbin isn't in the normal user's path, but I actually tried to run it today to check that and it still wouldn't let me run it even though I "World" had read-execute permissions on it. Go figure. Anyway, the command the the login screen menu runs is called /sbin/poweroff (which is a link to /sbin/halt) and /sbin/reboot.
All of these only let you run them if you are root. But......since mingetty (login manager or window manager, something like that) runs as root, I am assuming that the command is executed as root.
That is the best explanation I can give according to my understanding (guess work). BTW I don't know this for fact, it is just my opinion. This post intrigued my interest so I decided to look into it. But if anyone else has a better explanation I would certainly welcome it.
dAggressor
It\'s a long life, until you die
-
April 1st, 2003, 09:54 AM
#7
Hello oxygen.
I think this link HERE will solve your problem.
Your solution is called Sudo.
This is an excellent example of what sudo can be used for. I think its wise that a normal user cannot shut down in command mode. With sudo, you can
That way you dont have to mess with your paths and/or permissions.
Cheers.
Ubuntu-: Means in African : "Im too dumb to use Slackware"
-
April 1st, 2003, 12:55 PM
#8
if u have logged in with an admin account you can shutdown with command shutdown -y now
this command works on RH 8.0
-
April 1st, 2003, 01:01 PM
#9
If you use KDM as a login thing.. root can change the settings so that noone but root can reboot or shutdown (not even from GUI)..
The option can be found in the KDE config thingy.. (/me is on windows atm.. sorry)
ASCII stupid question, get a stupid ANSI.
When in Russia, pet a PETSCII.
Get your ass over to SLAYRadio the best station for C64 Remixes !
-
April 1st, 2003, 04:01 PM
#10
Member
I really appreciate all those replies, some are close to what am trying to figure out.
I think I need to make my question little more clear.
I have RH7.2 server installation. So if I add a new user and when that user is logged in he can shutdown the system from the GUI menu( KDE and GNOME) with default permissions.
But if the user try to do "/sbin/shutdown -h now" from a command line, it says he has to be the root even if the permission is 777 for the shutdown command.
Obviously this can be done using sudo ( as instronics mentioned) which is the best way and also it can be done if I set the setuid bit on the command. which is not at all a good way to do that.
What I am trying to figure out is how its letting the user ( under default condition) to shutdown from GUI and not from command line.
Thanx folks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|