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
.
- Open the virtual terminal for your new server.
-
Use a text editor to open the
sshd_config
file. For example, you can usenano
: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.
-
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 saysyes
:\PasswordAuthentication yes
3. Save the Changes and Exit
After making the changes:
- If you are using
nano
, save the file by pressingCtrl + O
, then pressEnter
to confirm. - 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
orDenyUsers
directives insshd_config
).
Whatβs Next?
Click here to head back to configuring JustDeploy
π₯ Step 1