SSH with public-private key authentication comes enabled by default with most Linux distributions. This is great because when I create accounts for remote users I don't have to email them sensitive info(passwords).
However, this process becomes useless when these users need to run sudo
-- the server is still asking for their passwords. That means I still need to generate passwords for these users and figure out how to securely get it to them.
I know about sudoers
file and NOPASSWORD
parameter. However, I feel uneasy enabling it. I would still want some sort of authentication before users can run sudo
commands.
While doing some research on this topic I found pam_ssh_agent_auth project, which from my understanding enables the same private/public key authentication as used for ssh connections but for sudo
command.
It seems like with this module in place we can have completely passwordless accounts.
Why is this module or similar process is not part of standard Linux distro configs? Is there some security caveat I'm missing why this is not more widely adopted? Why passworded sudo is considered to be more secure than public/private key sudo?