Monday, August 17, 2009

Publickey (no password) ssh/scp in Ubuntu (9.04 and maybe other)

As per launchpad

https://bugs.launchpad.net/ubuntu/+source/openssh/+bug/201786

There is a bug that prevents public key ssh/scp from working when configured according to 'man ssh'. (Due to the way ssh-agent / seahorse is setup )

The trick is to run 'ssh-add' after the normal procedure as per 'man ssh'.

So the entire procedure would be something like this.
  1. Generate keys on the local machine ($ ssh-keygen -t rsa -b 4096 #press enter twice, I'm using 4096 instead of the usual 2048 bit key)
  2. Copy the public key using ssh-copy ($ ssh-copy-id -i ~/.ssh/id_rsa.pub remoteuser@remotehost #assuming keys are in the standard location)
  3. Now make sure we run ssh-add ($ ssh-add )
That should do the trick!

No comments: