By userdo
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!
Heya @userdo,
In the sshd_config file there is a line that includes the sshd configs from the /etc/ssh/sshd_config.d/ directory:
Include /etc/ssh/sshd_config.d/*.conf
If you go into that folder and check the 50-cloud-init.conf you’ll see it has the PasswordAuthentication set to No.
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 like cat or less to view the file. Here’s how you can check the relevant configuration options:
Check the SSH configuration file:
- cat /etc/ssh/sshd_config
Look for the following lines in the sshd_config file:
- PasswordAuthentication no
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
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.