To connect to an Ubuntu server via SSH without a password, you need to set up SSH key-based authentication. The steps are:
ssh-keygen
This will create a public key (id_rsa.pub
) and a private key (id_rsa
) in the ~/.ssh/
directory.
ssh-copy-id remote_username@server_ip_address
This will append the public key to the ~/.ssh/authorized_keys
file on the remote server.
/etc/ssh/sshd_config
file:sudo nano /etc/ssh/sshd_config
Find the lines:
PasswordAuthentication yes ChallengeResponseAuthentication yes
and change them to:
PasswordAuthentication no ChallengeResponseAuthentication no
Then save the file and restart the SSH service:
sudo systemctl restart ssh ```[1][3][5] After completing these steps, you should be able to log in to the remote Ubuntu server using SSH without entering a password.[1][2][3]