SSH remote machine without password

From the machine that you wish to connect from, run the command below with the user that you will connect with to the remote machine:
In my example of command below; The user used was root.

run this command:

ssh-keygen -t dsa

From there you can run this command, replace remote_IP with the remote machine’s IP.

cat /root/.ssh/id_dsa.pub | ssh root@remote_IP 'cat >> /etc/ssh/keys-root/authorized_keys'

Next time, no password would be asked to gain access.

 

Leave a Reply