Thursday, September 18, 2008

Simple autologin per SSH

To allow login per SSH without entering the password, execute with the asked user following commands (one line) on the client-machine:
(replace <REMOTESERVER> with the ip/hostname of your remote server)

cat ~/.ssh/id_rsa.pub | ssh root@<REMOTESERVER> ‘mkdir ~/.ssh/ 2>/dev/null ; cat >> ~/.ssh/authorized_keys ; cat ~/.ssh/authorized_keys | uniq > ~/.ssh/authorized_keys.tmp ; mv ~/.ssh/authorized_keys.tmp ~/.ssh/authorized_keys’

If you get the error File “~/.ssh/id_rsa.pub” not found cancel with CTRL+C, execute command ssh-keygen and just hit enter to response questions. After that, call the first command again.

Posted by schmidi2 in 13:49:36 | Permalink | No Comments »