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 12-29-2008, 10:14 PM   #1
vitalstrike82
Member
 
Registered: Oct 2007
Location: Singapore
Distribution: OpenSuse, Slackware, Redhat
Posts: 318

Rep: Reputation: 40
Add user to sudoer list but cannot use root commands


Greetings,

I have add a user which is me into the sudoerlist as list on this webpage: http://www.pendrivelinux.com/2007/10...-sudoers-list/

After restarting my machine, i try to see if i can use the sudo command to retstart my machine. This is what it prompts:


Code:
sudo shutdown -r now
Next it prompts for password. After entering the password, it returns command not found. How do i solve this problem?


Thanks
 
Old 12-29-2008, 10:19 PM   #2
Romanus81
Member
 
Registered: Feb 2008
Posts: 201

Rep: Reputation: 31
Shutdown is not the $PATH of non-root owners, it is in /sbin

The command should be:
# sudo /sbin/shutdown -r now
 
Old 12-29-2008, 10:22 PM   #3
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=14, FreeBSD_12{.0|.1}
Posts: 5,557
Blog Entries: 11

Rep: Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533
Add /sbin to your PATH

To keep from having to add /sbin to all root commands used by sudoers, add /sbin to your path:

Code:
export PATH=$PATH:/sbin
Add that to ~/.bash_profile or to the global profile if you want all users to find sysadmin commands.
 
Old 12-31-2008, 08:27 AM   #4
Joe 6 Pack
LQ Newbie
 
Registered: Dec 2008
Location: Franklin, TN
Posts: 14

Rep: Reputation: 0
If you don't want to give all users access to all sysadmin commands, and/or you don't want to mess with your sudoers file, you could (for slackware 12.2 at least):

Code:
# cp /sbin/shutdown /usr/bin/
# cp /sbin/halt /usr/bin/reboot
# chmod u+s /usr/bin/shutdown /usr/bin/reboot
then you could shutdown or reboot as user without typing sudo or entering a user password:

Code:
$ shutdown -h now
or

Code:
$ reboot
 
  


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
How to list user in Linux box, add an user to a group! steady_lfcfan Linux - Newbie 12 01-27-2013 02:14 PM
permissions after sudoer add ikon2008 Linux - Newbie 2 08-04-2008 04:51 AM
root not a sudoer??? LinuxNewbie999 Fedora 8 03-03-2008 04:38 PM
Majordomo - add user to list noir911 Linux - Software 0 11-30-2007 10:56 AM
Root/User rights to Root commands? mrde50garfield Linux - Software 2 10-24-2006 06:42 AM

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

All times are GMT -5. The time now is 10:53 AM.

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