Enable Password Authentication for SSH

1. Open the SSH Configuration File

First, you need to open the SSH configuration file, which is typically located at /etc/ssh/sshd_config.

  1. Open the virtual terminal for your new server.
  2. Use a text editor to open the sshd_config file. For example, you can use nano:

    sudo nano /etc/ssh/sshd_config
    

    NOTE

    If using DigitalOcean, the sshd_config file may be located at /etc/ssh/sshd_config.d/50-cloudinit.conf instead, so make sure you update this.

2. Modify the SSH Configuration File

Locate the following lines in the file. If they are not present, you can add them.

  1. Look for the line that says PasswordAuthentication. If it is commented out (has a # at the beginning), uncomment it by removing the # and ensure it says yes:\

    PasswordAuthentication yes
    

3. Save the Changes and Exit

After making the changes:

  1. If you are using nano, save the file by pressing Ctrl + O, then press Enter to confirm.
  2. Exit the editor by pressing Ctrl + X.

4. Restart the SSH Service

To apply the changes, restart the SSH service using the following command:

sudo systemctl restart ssh

Troubleshooting

  • If you are still unable to use password authentication, ensure that there are no conflicting settings in the sshd_config file.
  • Make sure the SSH service restarted without errors by checking its status:

    sudo systemctl status ssh
    
  • Verify that your user account is allowed to log in via SSH and that there are no restrictions in place (e.g., AllowUsers or DenyUsers directives in sshd_config).

What’s Next?

Click here to head back to configuring JustDeploy
πŸ’₯ Step 1