Wednesday, September 30, 2009

'Password-less login with ssh'

These instructions explain what to do in order to be able to use ssh for
logging on a remote machine without entering your password.
All our machines use ssh protocol 2, so please follow the corresponding
instructions. However, for completeness, the instructions for protocol 1
are provided here as well.
Please note that all instructions pertain to
<a href="http://www.openssh.org/">OpenSSH</a>.

<h3>Protocol 2</h3>

On the originating machine, say<br>
<blockquote>
<b>ssh-keygen -t rsa</b>
</blockquote>
Save the key in the default file (~/.ssh/id_rsa) and do not use a passphrase.
This will create a file ~/.ssh/id_rsa.pub. Add the contents of this file to the
file ~/.ssh/authorized_keys2 on the <em>remote</em> machine (i.e., the machine
on which you want to log on). Whereas the id_rsa.pub file is world readable,
the authorized_keys2 file should only be readable by you. Use chmod to set the
permissions accordingly.