Access with Password Authentication

Before changing the password authentication switch the root user

sudo su 

Navigate to the /etc/ssh/sshd_config

Use the vi editor to edit the file

vi /etc/ssh/sshd_config

Change PermitRootLogin prohibited_password > PermitRootLogin yes

PasswordAuthentication yes

The below step applies only to Ubuntu 22.04

Now again Navigate to the /etc/ssh/sshd_config.d/60-cloudimg-settings.conf

vi /etc/ssh/sshd_config.d/60-cloudimg-settings.conf

Change PasswordAuthentication no > yes

Restart the SSHd service

systemctl restart sshd

Now set the password for the root user:

sudo password root

set the password

Now log in to the server with the root user

ssh root@Your_server_IP_add

Last updated