Hi.
Recently, we've configured our servers to require SSH keys and Yubikeys during SSH and password and Yubikey when using sudo. I'm looking for some feedback and experience with this kind of setup.
We did it like this:
Password authentication via SSH is also disabled.
Some clients has access to SSH but none of them with sudo access, of course.
Is there any possible problems with this setup?
I can think of one small issue: Granting cPanel support access to the servers.
They will need to login as a wheel user and use sudo - but won't be able to because there's no Yubikey configured.
Any feedback is much appreciated!
Recently, we've configured our servers to require SSH keys and Yubikeys during SSH and password and Yubikey when using sudo. I'm looking for some feedback and experience with this kind of setup.
We did it like this:
- Install pam_yubico from epel-release
- Configured /etc/pam.d/sshd` to include the following:
Code:auth required pam_yubico.so id=API_ID authfile=/etc/yubikeys
Code:auth substack password-auth
- Configured $user:$key-id in /etc/yubikeys
- Made the following changes in /etc/ssh/sshd_config and restarted the service:
Code:ChallengeResponseAuthentication yes Match User <username1>,<username2>,<...> AuthenticationMethods publickey,keyboard-interactive
- Included the following in /etc/pam.d/sudo:
Code:auth required pam_yubico.so id=API_ID authfile=/etc/yubikeys
Password authentication via SSH is also disabled.
Some clients has access to SSH but none of them with sudo access, of course.
Is there any possible problems with this setup?
I can think of one small issue: Granting cPanel support access to the servers.
They will need to login as a wheel user and use sudo - but won't be able to because there's no Yubikey configured.
Any feedback is much appreciated!