Linux - GeneralThis 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
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.
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Under Mandrake I could shut down as any user from any of the window managers. However, under Debian I am required to log out to GDM, and then to enter the root password in order to shut down. This sucks, because I don't want the other users of the computer to know the root password, but I do want them to be able to shut down. I know this is the "proper" way for it to behave (understandable if it is, e.g., a network server, or something) but I want to change it back to the Mandrake way.
I'm guessing that chmodding shutdown is a bad idea; are there alternatives here? And how do I inform GDM and KDE that the two stage shutdown is no longer required?
Actually, that may be what is necessary (but there may be a GUI tool already installed that'll do it neatly, globally, and correctly. I have Mepis installed, so it Deb and I can shutdown as user (only logged in to X as root once since the install and won't be doing it again soon). I'll look at my configs for kdm and see if theres somethigg onvious there. Might try adding the user to the shutdown group
i used to have users be able to shutdown and reboot without them having other commands, but i forgot how i did it. (adding the user to wheel, maybe?) sudo would work, but that would give users access to many or even most root commands. however, there might be a way to modify sudo so users only have access to the commands you want them to have. i agree that chmodding the shutdown command wouldn't necessarily be a bad thing if you know what you are doing and are sure that's what you want.
There is another way, which is not too elegant, if this cannnot be solved for you (like we'll let that happen!). Users can exit to a console and then hit ctrl+alt+del. That will spawn a reboot sequence. The filesystem will be unmounted properly and they can shut down with the switch the second the messages say "rebooting"
ACCESS CONTROL
shutdown can be called from init(8) when the magic keys CTRL-ALT-DEL
are pressed, by creating an appropriate entry in /etc/inittab. This
means that everyone who has physical access to the console keyboard can
shut the system down. To prevent this, shutdown can check to see if an
authorized user is logged in on one of the virtual consoles. Otherwise it will write the message
shutdown: no authorized users logged in to the (physical) system console.
If shutdown is called with the -a argument (add this to the
invocation of shutdown in /etc/inittab), it checks to see if the file
/etc/shutdown.allow is present. It then compares the login names in that
file with the list of people that are logged in on a virtual console (from
/var/run/utmp). Only if one of those authorized users or root is logged
in, it will proceed. The format of /etc/shutdown.allow is
one user name per line. Empty lines and comment lines (prefixed by a #)
are allowed. Currently there is a limit of 32 users in this file.
Note that if /etc/shutdown.allow is not present, the -a argument is
ignored.
This is from the 'shutdown' man page, it says that you can set up a file that will keep the command limited to some users but not others. You could create the 'shutdown.allow' file with the users you will want to be able to shutdown, then create an alias named 'halt', or some other name, with the "shutdown -a" as the command to be aliased. I hope this helps.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.