You are not logged in.
i am running fluxbox without a logon manager. i have it starting X at boot. i wood like to shutdown or reboot without using su. is there a script i can use or config file i can change?
Last edited by mivison (2008-01-16 23:46:41)
Offline
this question was just asked the other day. if I knew the thread I would point u to it, but that's why we have search feature.
I will see what I can find...
http://bbs.archlinux.org/viewtopic.php?id=41913&p=1 its in that thread, if I told u it was on the second page I'd be giving u to much of a hint!
Last edited by jacko (2008-01-14 04:12:58)
Offline
thank you
i will look too
Offline
Well, I use su and an alias, but without having to type a password. Just edit /etc/pam.d/su to make su trust users in the wheel group. After that you can add an alias to your ~/.bashrc:
alias off="su -c 'shutdown -h now'"
Same can be done with sudo, just type visudo as root, edit the file and add an alias to your bashrc:
alias off="sudo shutdown -h now"
Offline
For the sudo route, run visudo and add the user in as follows:
username ALL=(ALL) NOPASSWD:/sbin/halt,/sbin/reboot
Last edited by T-Dawg (2008-01-14 10:52:32)
Offline
doesnt adding the user to the power group work?
it works for me but im using xfce
Offline
The power group is only used by hal/dbus. Normal reboot/halt/poweroff/shutdown makes no use of it.
1000
Offline
If you have a button no your case or laptop you could setup acpi so it poweroff when you hit the button, that how I have my laptop setup. You could also change ctrl+alt+del to shutdown in terminal.
"The only thing we have to fear is fear itself." - Franklin D. Roosevelt
Offline
i tried using sudo, but it still asks for a password. also no matter what password i give it rejects it.
here is sudoers file:
# sudoers file.
#
# This file MUST be edited with the 'visudo' command as root.
# Failure to use 'visudo' may result in syntax or file permission errors
# that prevent sudo from running.
#
# See the sudoers man page for the details on how to write a sudoers file.
#
# Host alias specification
# User alias specification
# Cmnd alias specification
# Defaults specification
# Runas alias specification
# User privilege specification
root ALL=(ALL) ALL
%users ALL=NOPASSWD: /sbin/reboot
%users ALL=NOPASSWD: /sbin/halt
# Uncomment to allow people in group wheel to run all commands
# and set environment variables.
#%wheel ALL=(ALL) SETENV: ALL
# Same thing without a password
#%wheel ALL=(ALL) NOPASSWD: SETENV: ALL
# Samples
# %users ALL=/sbin/mount /cdrom,/sbin/umount /cdrom
# %users localhost=/sbin/shutdown -h now,/sbin/halt,/sbin/reboot
#%users ALL=/sbin/reboot
sudoers (END)
what am i doing wrong?
Last edited by mivison (2008-01-16 16:57:43)
Offline
Make sure your user is a member of the users group.
Offline
i think the most easy way will be to do a chmod +s halt
Offline
thanks every one!
solved
Gustavo was correct. my group name was wrong i changed "users" in these 2 lines to my group name.
%users ALL=NOPASSWD: /sbin/reboot
%users ALL=NOPASSWD: /sbin/halt
i thought "%users" meant all users other than root. i am new to linux and sometimes the "HOW TO" web sites get confusing.
Offline