I've got SSH secured about as well as I can but have a question - hope you don't mind.
I've generated the public key for my Macbook, put it on my Ubuntu server and configured SSH to use public key authentication. I'm then using the following command to connect to the Ubuntu server:
ssh ubuntudev -p 55222 -i /Users/me/.ssh/id_rsa_ubuntudev -o PubkeyAuthentication=yes
The first time I do this, Keychain Access pops up and asks for the password phrase I setup so I enter it and everything works fine i.e. I can SSH into by Ubuntu server without any problems. I work for a bit, exit the secure session and it's all good.
BUT then, later on when I want to start a new SSH session, I hit the same command and I get this:
macbook:.ssh me$ ssh ubuntudev -p 55222 -i /Users/me/.ssh/id_rsa_ubuntudev -o PubkeyAuthentication=yes
Identity added: /Users/me/.ssh/id_rsa_ubuntudev (/Users/me/.ssh/id_rsa_ubuntudev)
Received disconnect from 192.168.17.52: 2: Too many authentication failures for me
What does that mean? I'm confused as to why I'm allowed to login once but only once. I can 'fix' it by doing this:
to remove all identities but that's obviously not the way to do this properly.
Can any of you help?