Open
Description
The aim is to add an option to allow admin user to login only using SSH with its key (No local console, ...). This is the common behavior on cloud servers.
Requirements:
- Remove user password (
passwd -d username
) - Ensure user can still sudo once logged, the only solution that doesn't require enabling SSH agent forwarding is to disable password (Edit
/etc/sudoers
to addusername ALL=(ALL) NOPASSWD:ALL
at end of file).
Also, it is possible to restrict users allowed to use SSH by editing /etc/ssh/sshd_config
and adding AllowUsers username
.