Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
sudo not allowing access [solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
grx
Apprentice
Apprentice


Joined: 19 Jan 2005
Posts: 173
Location: Maryland

PostPosted: Mon Apr 17, 2006 4:51 am    Post subject: sudo not allowing access [solved] Reply with quote

I've put these lines into /etc/sudoers:

Code:
# User privilege specification
root    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

# Users in group www are allowed to  edit httpd.conf and ftpd.conf
# using sudoedit, or sudo -e, without a password.
# %www          ALL=(ALL)       NOPASSWD: sudoedit /etc/httpd.conf, /etc/ftpd.conf

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

george   localhost = /usr/libexec/xfsm-shutdown-helper
george   localhost = /usr/bin/emerge


now if I try to run anything, it gives me this:

Code:
 sudo -l
Password:
Sorry, user george may not run sudo on washington.


/var/log/messages gets this line:
Code:
Apr 16 22:46:12 washington sudo:    george : command not allowed ; TTY=pts/0 ; PWD=/home/george ; USER=root ; COMMAND=list


What gives? Am I misunderstanding how to put the lines into the sudoers file?


Last edited by grx on Mon Apr 17, 2006 6:24 pm; edited 1 time in total
Back to top
View user's profile Send private message
phajdan.jr
Retired Dev
Retired Dev


Joined: 23 Mar 2006
Posts: 1777
Location: Poland

PostPosted: Mon Apr 17, 2006 6:52 am    Post subject: Reply with quote

Change 'localhost' to 'ALL'.
Back to top
View user's profile Send private message
grx
Apprentice
Apprentice


Joined: 19 Jan 2005
Posts: 173
Location: Maryland

PostPosted: Mon Apr 17, 2006 2:18 pm    Post subject: Reply with quote

That works, but I'd rather not make it possible to sudo remotely. What do I have to fix to get it to work that way?
Back to top
View user's profile Send private message
phajdan.jr
Retired Dev
Retired Dev


Joined: 23 Mar 2006
Posts: 1777
Location: Poland

PostPosted: Mon Apr 17, 2006 5:40 pm    Post subject: Reply with quote

Well, it doesn't work like that. There is a 'host' entry because the same sudoers file can be used on several machines. Then each computer reads only 'his' entries... It's not a host you connect from, but a host you run command on.

I don't know how to setup it in the way you want. You could create another user, not allowed to connect remotely etc. But in my opinion there is nothing to worry about. Just give the user a strong password, block the account after say 3 failed login attempts, maybe with some combination with port knocking / one time passwords... It should be quite safe, really.
Back to top
View user's profile Send private message
grx
Apprentice
Apprentice


Joined: 19 Jan 2005
Posts: 173
Location: Maryland

PostPosted: Mon Apr 17, 2006 6:23 pm    Post subject: Reply with quote

Actually, I just discovered that the problem is the "localhost". It needs the actual host name, so when I change it to "washington", it works fine. Thinking about it, I decided to keep the ALL anyway. Thanks all!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum