Originally Posted by fahadsaeed
(snip by fsck)
ssh-keygen -t rsa
ssh firstname.lastname@example.org "mkdir -p .ssh;chmod 0700 .ssh"
scp .ssh/id_rsa.pub email@example.com:/tmp
ssh firstname.lastname@example.org "cat /tmp >>/home/admin/.ssh/authorized_keys2
Sorry, let me be clearer.
If you have run "cat /tmp >> authorized_keys2", then your authorized_keys2 file may well be corrupted, and any additional keys added to it may not be recognised.
If you ONLY want to use the key you are now copying for authorisation, then run the commands again but change the last line to read:
(Note! There is only 1 ">" in that command, it will overwrite the authorized_keys file)
ssh email@example.com "cat /tmp/id_rsa.pub >/home/admin/.ssh/authorized_keys2
If there are keys in the existing file which need to be saved, you should copy the file to one side to make a backup, then edit authorized_keys2 to leave only the keys in the file, and not the corruption.
Also, ensure that your "identity" key in the local .ssh directory is set correctly, or use the "-i" option to ssh.