Gnuru.org
Adventures in Linux


SSH without a password
15 March 2008 @ 09:57 GMT
by Paul


When you work on a remote machine to which you have SSH access, it can be a real nuisance to have to continually enter the password every time you want to do something. This is particular true when editing files on the remote machine, say, using Emacs's "tramp" functionality.Here's how to access SSH without typing in a password.

First generate the key for the client on the client machine:

ssh-keygen -t rsa

This generates a public/private key pair. The '-t' switch indicates that you are doing it to produce a key for ssh version 2. Do not enter a passphrase.

Copy the key across to the remote machine typing the password when prompted:

cat .ssh/id_rsa.pub | ssh user@remote.host 'cat >>
   .ssh/authorized_keys'

Now you should be able to ssh to the remote host without entering a passphrase.

Tags: security ssh


Leave a comment:

Are you human?