Can't halt or reboot with user account!!!!!!
Hi, guys
Sorry for bothering again, but do you know how can i halt or reboot my system with my user account. i can do that under root, but not with user. it's a lil not comfy. Thanks a looot! |
Most distro's have a gui to configure these things, don't know about Slackware.
You can also use the command line. Create (check) a file in /etc called shutdown.allow, put the user in there. Check man shutdown, the ACCESS CONTROL section. |
Hi,
thanks for the tipp, but i don't have this file. any other ideas? |
Take a peak at the man shutdown page. I believe it gives information on how to setup a shutdown.allow page. You would need to create it in Slackware. :D
|
well i checked the man shutdown & i saw that i miss
/etc/init.d/halt /etc/init.d/reboot what should i do next? |
reboot or halt from unprivileged accounts
On my systems I prefer not to follow this method. I just use "su -c reboot" or "su -c halt"
This will ask for the root password and thats it. No need to do any configuring. simple. |
Keep in mind that the man pages are generic for the tool and assume that all *nixes are the same. They are not. For slackware, the halt/shutdown file is found in /etc/rc.d/rc.6.
|
you just need the permission to run /sbin/shutdown and then set an alias to it.
you can do that with "chmod +s /sbin/shutdown" as root. And then ad an alias to your ~/.bashrc : alias off=´/sbin/shutdown -h now´ ;) |
eeeh, i guess I'd consider that somewhat of a security risk having users able to reboot or halt the system. A friend of mine did it a lot as an annoyance to me when i did have it set. Angered me severly ;-P
|
i am stuck! can someone explains it for a newbie? it's really frustrating!
|
In order to shutdown you can type this in a console...
su -c "shutdown -h now" to reboot.. su -c "reboot" In BOTH cases it will ask for the root password. This is your best and easiest bet for now. |
If you are physically at the machine another way is to configure it so that ctrl-alt-del halts the machine.
See this thread |
Read the manpage of sudo. It's a secure way to allow users to shutdown/restart the computer -- no permisions to change.
man sudo |
In slackware:
Using root, in Konqueror (file manager) on advanced permissions menu: set uid for /sbin/shutdown and add menu items: for Halt - power down: command: /sbin/shutdown -h now for Reboot - power up: command: /sbin/shutdown -r now |
you have to setuid /usr/sbin/halt
as root do: chmod a+s /usr/sbin/halt chmod a+s /usr/sbin/reboot but make sure /usr/sbin path in your $PATH. if doesnt then create symlink from your path to /usr/bin. |
All times are GMT -5. The time now is 09:45 PM. |