Results 1 to 5 of 5

Thread: Sudo help

  1. #1
    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

  2. #2
    Join Date
    Apr 2005
    Posts
    1,767
    Cmnd_Alias STUFF = /usr/bin/ssh
    User_Alias USERS = tech
    USERS STUFF = NOPASSWD: STUFF

  3. #3
    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

  4. #4
    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

  5. #5
    Join Date
    May 2006
    Location
    NJ, USA
    Posts
    6,645
    Voila, thanks guys.





    __________________
    - Dougywww.justedge.net

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •