Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
sudoers: NOPASSW only if using key with SSH - possible?
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
VinzC
Watchman
Watchman


Joined: 17 Apr 2004
Posts: 5098
Location: Dark side of the mood

PostPosted: Tue Mar 17, 2009 10:22 am    Post subject: sudoers: NOPASSW only if using key with SSH - possible? Reply with quote

Hi.

I'd like sudo to not ask for a password only if I logged in through SSH using my private key. If I log on through SSH with a password, I want sudo to prompt for a password. Does such a feature exist?

Thanks in advance.
_________________
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739!
Back to top
View user's profile Send private message
VinzC
Watchman
Watchman


Joined: 17 Apr 2004
Posts: 5098
Location: Dark side of the mood

PostPosted: Tue Mar 17, 2009 12:36 pm    Post subject: Reply with quote

I've found a workaround: if the number of users who can logon using SSH is small, then all I need to do was
  1. create a user account with password unset
  2. add my public key to the authorized_keys file
  3. put the user name in /etc/sudoers and use the NOPASSWD: hint.
Note I had to move the user-specific directives below the group-specific section in /etc/sudoers. Now with ssh-agent it's even faster 8) !
_________________
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739!
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