Bi-directional passwordless ssh
Boy, passwordless ssh is a pain in the ass. Something so simple, can cause me to rip my hair out. So a tut to myself to make sure I don't go through quite the torture that I just went through.
Need to have openssh installed on all machines. Check that the config is set up right... /etc/ssh/sshd_config ... must restart sshd service if you make a change here.Create the .ssh directory off your home directory (mkdir .ssh). Do a chmod 700 .ssh ... this turns out to be important.Follow these commands... all done from your home directory of the local and remote computer. $local ssh-keygen -t dsa$local scp ~/.ssh/id_dsa.pub REMOTE:.
$remote cat ~/id_dsa.pub >>~/.ssh/authorized_keys
$remote ssh-keygen -t dsa
$local scp REMOTE:.ssh/id_dsa.pub .
$local cat ~/id_dsa.pub >>~/.ssh/authorized_keys Also do a chmod 700 ~/.ssh/authorized_keys on both the remote and local ... yes, important.The ultimate goal that the above commands accomplish... is to get a copy of the local machines public key (found in id_dsa.pub) and get it appended to the remote machines authorized_keys file. Now should be able to do a ssh MACHIINE date without a password. ssh into both the local and remote machine from both computers.
Comments [0]