View previous topic :: View next topic |
Author |
Message |
VinzC Watchman
![Watchman Watchman](/images/ranks/rank-G-2-watchman.gif)
![](images/avatars/92679028148bc3f0ff1e99.jpg)
Joined: 17 Apr 2004 Posts: 5098 Location: Dark side of the mood
|
Posted: Tue Mar 17, 2009 10:22 am Post subject: sudoers: NOPASSW only if using key with SSH - possible? |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
VinzC Watchman
![Watchman Watchman](/images/ranks/rank-G-2-watchman.gif)
![](images/avatars/92679028148bc3f0ff1e99.jpg)
Joined: 17 Apr 2004 Posts: 5098 Location: Dark side of the mood
|
Posted: Tue Mar 17, 2009 12:36 pm Post subject: |
|
|
I've found a workaround: if the number of users who can logon using SSH is small, then all I need to do was - create a user account with password unset
- add my public key to the authorized_keys file
- 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 ! _________________ Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739! |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|