LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 11-30-2004, 05:15 AM   #1
akudewan
Member
 
Registered: Apr 2004
Location: India
Distribution: Ubuntu
Posts: 364

Rep: Reputation: 30
Thumbs down 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??
 
Old 11-30-2004, 05:21 AM   #2
KMcD
Member
 
Registered: Jun 2003
Location: Dublin, Ireland
Distribution: Slack -- current
Posts: 354

Rep: Reputation: 30
try sudo. You'll need to edit the config file using the command visudo
 
Old 11-30-2004, 05:49 AM   #3
Slovak
Member
 
Registered: Oct 2004
Location: North Olmsted, Oh
Distribution: Slackware 10
Posts: 206

Rep: Reputation: 30
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
 
Old 11-30-2004, 06:18 AM   #4
KMcD
Member
 
Registered: Jun 2003
Location: Dublin, Ireland
Distribution: Slack -- current
Posts: 354

Rep: Reputation: 30
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.

Last edited by KMcD; 11-30-2004 at 06:21 AM.
 
Old 11-30-2004, 04:52 PM   #5
ringwraith
Senior Member
 
Registered: Sep 2003
Location: Indiana
Distribution: Slackware 14.2
Posts: 1,266

Rep: Reputation: 56
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
 
Old 11-30-2004, 06:11 PM   #6
coffeedrinker
Member
 
Registered: Sep 2003
Posts: 173

Rep: Reputation: 30
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
 
Old 12-01-2004, 09:29 AM   #7
salahuddin_66
Member
 
Registered: Jan 2004
Location: Dhaka, Bangladesh
Distribution: Debian, Gentoo
Posts: 283

Rep: Reputation: 30
have try by giving

chmod a+x /sbin/halt
chmod a+x /sbin/reboot
 
Old 12-02-2004, 08:06 AM   #8
akudewan
Member
 
Registered: Apr 2004
Location: India
Distribution: Ubuntu
Posts: 364

Original Poster
Rep: Reputation: 30
Smile

Quote:
chmod a+x /sbin/halt
Yup, that did the trick. Thanks salahuddin_66.
 
Old 12-03-2004, 01:30 AM   #9
UltimaGuy
Member
 
Registered: Aug 2003
Location: Chennai, India
Distribution: PCLinuxOS .92, FC4
Posts: 840

Rep: Reputation: 32

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 ?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
I do not have superuser power halfpower Debian 4 08-20-2005 10:02 AM
Superuser CJ_Grobler Linux - Newbie 7 06-13-2005 10:35 PM
Superuser for Mount? Jskill007 Slackware 5 08-29-2004 11:53 PM
Making a second superuser slickrcbd Linux - Security 4 12-25-2003 01:49 AM
superuser snu *BSD 5 07-22-2003 10:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 10:56 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration