SSH login without password (authorized_keys)
diffract.me
diffract.me
So:
Step 1:
ssh-genkey
Step 2: ssh-copy-id user@host
Done. ssh-copy-id 'user@host -p1337'
Took me far too long to figure this out :\ ssh-keygenInstall Keychain (http://www.gentoo.org/proj/en/keychain/), so you can actually use a passphrase like a smart person and not have to deal with ssh-agent and ssh-add nonsense.
1. Use SSH connection multiplexing
If you are connecting to same computer multiple times, this saves up quite a bit of time http://www.revsys.com/writings/quicktips/ssh-faster-connecti...
2. Use autossh
For a persistent ssh connection (ex. for reverse tunnels) http://www.debianadmin.com/autossh-automatically-restart-ssh...
2) use ssh-copy-id to install your public key on a remote (and fix up the permissions on ~/.ssh etc. which for me is the #1 case of key based login not working).
DOH! I just spent the past 15 minutes trying to figure out why it wasn't working until I stumbled upon my .ssh directory having worldly permissions. Was just about to come here and post the same thing. chmod 700 is your friend!
You should run ssh -vvv on a normal, working connection at least once to get a sense of what normal output is.
So basically ssh-agent should be always running and you add your key to it (via ssh-add) and you never enter your password again, but the key still is generated with a passphrase? Correct?
Thanks
Never leave your key without a passphrase!
A good series of articles on ssh bt Brian Hatch can be found here - http://www.hackinglinuxexposed.com/articles/20021211.html
According to the MAN documentation for ssh-keygen, host keys must have an empty passphrase, so just leave it blank.
We're not making a host key here, are we? Shouldn't a passphrase be employed?