View previous topic :: View next topic |
Author |
Message |
MdaG l33t
Joined: 09 Nov 2004 Posts: 945 Location: Stockholm, Sverige
|
Posted: Tue Dec 14, 2004 9:07 pm Post subject: Shutting of the computer |
|
|
Is it possible to shut off the computer (clean) without being root? I'm running a deskop and don't really need to be root just to turn off the comp. |
|
Back to top |
|
|
Vanquirius Retired Dev
Joined: 14 Jun 2002 Posts: 1297 Location: Ethereal plains
|
Posted: Tue Dec 14, 2004 9:27 pm Post subject: |
|
|
I'm not sure if you can do it as a user, but you could always set-up sudo to allow you to halt your machine. You could also have an alias for "sudo halt". _________________ Hello. |
|
Back to top |
|
|
malone Apprentice
Joined: 19 Feb 2004 Posts: 159 Location: The p-n junction.
|
Posted: Tue Dec 14, 2004 9:48 pm Post subject: |
|
|
Or you can setuid /sbin/shutdown though the man page says shutdown wasn't designed for that,
Code: | chmod u+s /sbin/shutdown |
and any user can run shutdown. _________________ malone |
|
Back to top |
|
|
MdaG l33t
Joined: 09 Nov 2004 Posts: 945 Location: Stockholm, Sverige
|
Posted: Tue Dec 14, 2004 10:10 pm Post subject: |
|
|
malone wrote: | Or you can setuid /sbin/shutdown though the man page says shutdown wasn't designed for that,
Code: | chmod u+s /sbin/shutdown |
and any user can run shutdown. |
"..wasn't designed for that" ?
The thing is, I'd like to create a "button" so that I can turn of my computer "XP-style". |
|
Back to top |
|
|
malone Apprentice
Joined: 19 Feb 2004 Posts: 159 Location: The p-n junction.
|
Posted: Tue Dec 14, 2004 10:30 pm Post subject: |
|
|
Quote: | "..wasn't designed for that" ? |
I assume it means that there wasn't any extra attention paid to security.
From the man page,
Quote: | Shutdown wasn't designed to be run setuid. |
That's all it says on the topic. This is the solution that I use on my ancient laptop that doesn't have any kind of gui except X to run an xvnc session. You want it as a button, no problem - just make it execute a command like,
Code: | /sbin/shutdown -h now |
You should also be able to setuid on some of the other ones such as /sbin/poweroff and /sbin/reboot. It's been a while since I use kde, but iirc poweroff is more along the lines of what people usually want instead of a system halt. _________________ malone |
|
Back to top |
|
|
MdaG l33t
Joined: 09 Nov 2004 Posts: 945 Location: Stockholm, Sverige
|
Posted: Wed Dec 15, 2004 9:07 am Post subject: |
|
|
What's the difference between system halt and power off?
I'm running fluxbox so I have to make all my "shortcuts" myself. |
|
Back to top |
|
|
To Veteran
Joined: 12 Apr 2003 Posts: 1145 Location: Coimbra, Portugal
|
Posted: Wed Dec 15, 2004 9:55 am Post subject: |
|
|
MdaG wrote: | What's the difference between system halt and power off?
I'm running fluxbox so I have to make all my "shortcuts" myself. |
Same thing.
Tó _________________
------------------------------------------------
Linux Gandalf 3.2.35-grsec
Gentoo Base System version 2.2
------------------------------------------------ |
|
Back to top |
|
|
malone Apprentice
Joined: 19 Feb 2004 Posts: 159 Location: The p-n junction.
|
Posted: Wed Dec 15, 2004 1:06 pm Post subject: |
|
|
Quote: | What's the difference between system halt and power off? |
Why not try them both out and see? They do almost the same thing but not quite. Halting the system brings everything down but your computer will still be on, you'll still be able to see output on your monitor, hear the fan running, etc. Poweroff does everything halt does but then does a poweroff. In fact, /sbin/halt has an option -p :
Quote: | -p When halting the system, do a poweroff. This is the default when halt is called as poweroff. |
_________________ malone |
|
Back to top |
|
|
|