I'm using an old login with ssh-rsa public/private key and all was good.
I noticed that a couple of days ago the authorizazion was avoid with message "server refused our keys". After diggin' I figured out that the couple of keys stop working after exactly 5 years of their creation.
So I make a new pair of keys, take the public one, paste inside a file in ~/.ssh of the username that I'm using, converted it with ssh-keygen -if
and paste the new file into authorized_keys
but the I still get "server refused our key".
It's ok to copy and paste the real key without transfer it?
What I'm missing? This isn't my first time using a pair of keys and I follow the same procedure as described. I'm in doubt if I'm changing the correct authorized_keys
file but I've take a look in /etc/passwd
and see where is the home of the login which I'm using.
To my knowledge, its not nessessary to do the
ssh-keygen -if
on the remote machine. Just copy the public part of your keypair (e.g. id_rsa.pub) to the remote machine and append it to the ~/.ssh/authorized_keys file.There is also a neat utility that does it all for you: ssh-copy-id.
ssh-copy-id [-i [identity_file]] [user@]machine
Also make sure the key is loaded with
ssh-add -l
.