LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   How do I get sudo to work? (https://www.linuxquestions.org/questions/slackware-14/how-do-i-get-sudo-to-work-506977/)

Efwis 12-02-2006 09:50 PM

How do I get sudo to work?
 
hi everyone,

I'm not exactly new to Linux, been using it for almost a year now. But I am new to Slackware.

I just installed Slackware 11.0 and cant' figure out how to give my non-root user Sudo access. I entered the user in the sudoers file with the All command, but when I go to use sudo I get the following error.

Quote:

edward is not allowed to run sudo on edward. This incident will be reported.
below is a copy of my sudoers file entries, did I put something in there wrong or did I miss some info when I set it up.

Code:

# sudoers file.
#
# This file MUST be edited with the 'visudo' command as root.
#
# 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
edward  All=(ALL) ALL
# Uncomment to allow people in group wheel to run all commands
# %wheel        ALL=(ALL)        ALL

# Same thing without a password
# %wheel        ALL=(ALL)        NOPASSWD: ALL

# Samples
# %users  ALL=/sbin/mount /cdrom,/sbin/umount /cdrom
# %users  localhost=/sbin/shutdown -h now

Any help would be appreciated.

runnerfrog 12-02-2006 10:05 PM

¿Why don't you just add user edward to group wheel and uncomment the line that allow group wheel to run all commands? That enhance your administration of privileged users.

Efwis 12-02-2006 10:24 PM

Quote:

Originally Posted by runnerfrog
¿Why don't you just add user edward to group wheel and uncomment the line that allow group wheel to run all commands? That enhance your administration of privileged users.

If I see correctly, that eliminates the need of using a password. This is not acceptable since I am only wanting the one user on the system besides Root. My Kids use this system also, and I don't want to take a chance of them breaking the install by accidentally removing a file. they may be young, but that can also make them more dangerous to an OS.

zetabill 12-02-2006 10:27 PM

I believe "ALL" needs to be all caps.
Code:

# User privilege specification
root        ALL=(ALL) ALL
edward  All=(ALL) ALL

Code:

edward  ALL=(ALL) ALL

runnerfrog 12-02-2006 10:34 PM

Quote:

Originally posted by Efwis:
If I see correctly, that eliminates the need of using a password.
That is incorrect, Efwis. If you uncomment this only line (the one i said):
Quote:

# %wheel ALL=(ALL) ALL
your sudoers (user edward) will need to enter their personal password, _only_ the users you add to group wheel, will have the privilege.

Efwis 12-02-2006 10:59 PM

Quote:

Originally Posted by runnerfrog
That is incorrect, Efwis. If you uncomment this only line (the one i said):

your sudoers (user edward) will need to enter their personal password, _only_ the users you add to group wheel, will have the privilege.

thanks for that info. when I went to use sudo after setting that it didn't ask for my password when I was expecting it to. thats why I figured that was the case.

Quote:

Originally Posted by zetabill
I believe "ALL" needs to be all caps.

you were correct, that is what I did wrong, I didn't even catch that little typo :o

Thanks to both of you I now have that fixed. Just so you know I went with the route I was trying before using
Code:

# User privilege specification
root        ALL=(ALL) ALL
edward  ALL=(ALL) ALL

I will remember the wheel part if the need arises.

hitest 12-03-2006 10:19 AM

Hey Efwis,

Just saw your post here. Glad you got that sorted out man:-) Efwis is a buddy of mine:-) Welcome to the LQ Slackware forum!!
To simplify things for me I usually add my user to the wheel group and cdrom group when I set-up my user account when I first install Slackware.


All times are GMT -5. The time now is 07:40 PM.