LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Reboot: must be superuser (https://www.linuxquestions.org/questions/slackware-14/reboot-must-be-superuser-260847/)

akudewan 11-30-2004 04:15 AM

Reboot: must be superuser
 
I have tried and tried but never been able to get slackware to reboot and halt for non-root users. how the heck am I supposed to do it? this is what I have tried so far:

Code:

akudewan@ranjan404:~$ which reboot
/usr/local/bin/reboot
akudewan@ranjan404:~$ ls -l /usr/local/bin/reboot
lrwxrwxrwx  1 root root 12 2004-06-06 22:24 /usr/local/bin/reboot -> /sbin/reboot*
akudewan@ranjan404:~$ cd /sbin
akudewan@ranjan404:/sbin$ ls -l reboot
lrwxrwxrwx  1 root root 4 2004-07-20 18:31 reboot -> halt*
akudewan@ranjan404:/sbin$ ls -l halt
-rwxrwxrwx  1 root bin 8768 2004-06-21 22:03 halt*
akudewan@ranjan404:/sbin$ su
Password:
root@ranjan404:/sbin# chmod 777 halt
root@ranjan404:/sbin# ls -l halt
-rwxrwxrwx  1 root bin 8768 2004-06-21 22:03 halt
root@ranjan404:/sbin# exit
exit
akudewan@ranjan404:/sbin$ reboot
reboot: must be superuser.
akudewan@ranjan404:/sbin$

Can someone help please??

KMcD 11-30-2004 04:21 AM

try sudo. You'll need to edit the config file using the command visudo

Slovak 11-30-2004 04:49 AM

visudo /etc/sudoers (really, any text editor should work)

yourusername yourhostname = NOPASSWD: /sbin/reboot, /sbin/halt -h now, /sbin/halt

This user can now shutdown via sudo without a password.

To enable shutdown/reboot from within gnome (ala the way DL GNOME sets it up):

mkdir /var/run/console
touch /var/run/console/yourusername
chmod +s /sbin/reboot
chmod +s /sbin/halt

KMcD 11-30-2004 05:18 AM

just type visudo as it says in the sudoers man page.........

Quote:

man sudoers:

CAVEATS
The sudoers file should always be edited by the visudo
command which locks the file and does grammatical checking.
It is imperative that sudoers be free of syntax errors since sudo
will not run with a syntactically incorrect sudoers file.

ringwraith 11-30-2004 03:52 PM

Or if you are not very security conscious (like me as I am on a single user home machine behind a firewall) you can chmod +s /sbin/halt

coffeedrinker 11-30-2004 05:11 PM

You can also use CTL-ALT-DEL to reboot or shutdown. The default is to reboot but this this is what I use to shutdown. Just change it in inittab

ca::ctrlaltdel:/sbin/shutdown -t5 -h now

salahuddin_66 12-01-2004 08:29 AM

have try by giving

chmod a+x /sbin/halt
chmod a+x /sbin/reboot

akudewan 12-02-2004 07:06 AM

Quote:

chmod a+x /sbin/halt
Yup, that did the trick. Thanks salahuddin_66.

UltimaGuy 12-03-2004 12:30 AM


mkdir /var/run/console
touch /var/run/console/yourusername
chmod +s /sbin/reboot
chmod +s /sbin/halt


This worked for me :) Care to explain how this works ?


All times are GMT -5. The time now is 12:39 AM.