Looks to me like default for droplets even when choosing SSH keys, is there’s no line saying PasswordAuthentication no So is it that even with SSH keys specified, it still allows people to log in with a password?! Ubuntu 23.10 x64
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
In general, when using SSH keys for authentication on an Ubuntu server, the default configuration does not allow password-based authentication by default. However, it’s essential to confirm the server’s SSH configuration to ensure that password-based authentication is indeed disabled.
You can check the SSH server configuration by looking at the
/etc/ssh/sshd_config
file. You can use a text editor or a command likecat
orless
to view the file. Here’s how you can check the relevant configuration options:Check the SSH configuration file:
Look for the following lines in the
sshd_config
file:If you find this line, it means that password-based authentication is disabled, and SSH keys are required for authentication. If the line is missing or commented out (with a
#
at the beginning), it means the default behavior is still allowing password-based authentication.Also as mentioned there are additional sshd config files that you might need to inspect to verify if the password authentication is disabled.
Regards
Heya @userdo,
In the
sshd_config
file there is a line that includes the sshd configs from the/etc/ssh/sshd_config.d/
directory:If you go into that folder and check the
50-cloud-init.conf
you’ll see it has the PasswordAuthentication set toNo
.