Report this

What is the reason for this report?

Change SSH Keys Auth to Password Auth

Posted on November 7, 2024

I created a droplet with SSH keys authentication. However, I want to change this to accept password authentication. I have changed the sshd_config to allow this but the ssh service still only seems to accept keys.



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.

Hey there!

To enable password authentication on your Droplet, make sure you’ve configured the SSH settings correctly. Can you confirm that you’ve updated the /etc/ssh/sshd_config file and not the /etc/ssh/ssh_config file? The former is the server-side configuration file, while the latter is the client-side configuration file.

  • Open the SSH configuration file on your Droplet:
    sudo nano /etc/ssh/sshd_config
    
  • Look for these lines and set them as follows:
    PasswordAuthentication yes
    

Also, after making the changes, save and close the file, then restart SSH for the changes to take effect:

sudo systemctl restart ssh

Let me know if that gets things working for you!

- Bobby

Heya, @77a8c39df5da495389dbc5a28f3436

On some systems, SELinux or other security frameworks may interfere with the SSH configuration changes. You can check the current SELinux status with:

getenforce

If it’s set to Enforcing, try temporarily switching it to Permissive with:

sudo setenforce Permissive

Then test the SSH connection again.

If you still can’t log in with a password, check /var/log/auth.log (on Ubuntu) or /var/log/secure (on CentOS) for messages that might give a clue about why the password login is failing.

Regards

Heya,

There are typically a few things you need to check, first is if you made the change properly in your /etc/ssh/sshd_config. Make sure that there isn’t a typo on the line -

PasswordAuthentication yes

Make sure to restart the sshd service afterward as well service sshd restart

If you are still experiencing the same outcome, check your ssh folder and configs if there aren’t any other options that could be preventing you from continuing.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.