Results 1 to 5 of 5
Thread: Sudo help
-
11-27-2008, 10:18 AM #1Rockin' the beer gut
- Join Date
- May 2006
- Location
- NJ, USA
- Posts
- 6,645
Sudo help
For the life of me, I can't make this work.
I have the user "tech" added to my system. I want that user (tech) to be able to use sudo, but for only *one* command. ssh. I also want this to utilize the "NOPASSWD" feature.
What's the line I need to add to /etc/sudoers to allow only SSH (and sudo with the no password).
__________________
- Dougywww.justedge.net
-
11-27-2008, 11:21 AM #2Web Hosting Master
- Join Date
- Apr 2005
- Posts
- 1,767
Cmnd_Alias STUFF = /usr/bin/ssh
User_Alias USERS = tech
USERS STUFF = NOPASSWD: STUFF
-
11-27-2008, 01:08 PM #3Rockin' the beer gut
- Join Date
- May 2006
- Location
- NJ, USA
- Posts
- 6,645
[tech@console ~]$ sudo ssh <<ip>>
tech is not allowed to run sudo on console. This incident will be reported.
audit_log_user_command(): Connection refused
__________________
- Dougywww.justedge.net
-
11-27-2008, 03:45 PM #4Junior Guru
- Join Date
- Mar 2009
- Location
- deep blue yonder
- Posts
- 176
replace:
USERS STUFF = NOPASSWD: STUFF
with:
USERS ALL = NOPASSWD: STUFF
Hint: edit /etc/sudoers through visudo and it will complain on mistakes
e.g.
Warning: undeclared Host_Alias `STUFF' referenced near line 24
If you don't want to use the aliases, just write:
tech ALL = NOPASSWD: /usr/bin/ssh
-
11-27-2008, 03:56 PM #5Rockin' the beer gut
- Join Date
- May 2006
- Location
- NJ, USA
- Posts
- 6,645
Voila, thanks guys.
__________________
- Dougywww.justedge.net