Pages

Friday, June 16, 2006

Passwordless ssh connection with another server

First, create the key on the local machine (without a passphrase)



Then create a directory on the remote machine:



Finally append new key to remote .ssh/authorized_keys file:



Note

In place of the last command you could have also used:



but in the case your public key file does not contain a newline character at the end of the file (which probably it does not) the final concatenation on the `authorized_keys` will end up with long text line without newlines between the keys, thus making the file invalid. Tee on the other hand prepends the concatenation with a newline, keeping `authorized keys` happy.