I backed up my ~/.ssh folder and reinstalled ubuntu 13.10 on my machine. Then I just copied the .ssh folder back into my home folder and tried to connect to my server. I'm getting the following error: "Permission denied (publickey).". This is my .ssh folder on the client machine:

drwx------  2 user group 4096 Feb 25 21:21 . drwxr-xr-x 24 user group 4096 Feb 27 10:48 ..
-rw-r--r--  1 user group 1992 Feb  4 08:08 known_hosts
-rw-------  1 user group 3326 Nov 25 17:37 key
-rw-r--r--  1 user group 747 Nov 25 17:37 key.pub

Everything was working fine before the new installation. Do I have to somehow register the private key at the client machine? The server is a 12.04.

  • 2
    how do you connect to the server? have you tried with "ssh -vvv -i .ssh/key remoteserver"? – c4f4t0r Feb 27 '14 at 10:56
  • Thank you very much, that worked! Make it an answer and I mark it right. – Wipster Feb 27 '14 at 11:10
  • ok, i given one answer – c4f4t0r Feb 27 '14 at 13:26

ssh search for private keys in the following mode .ssh/id_rsa && .ssh/id_dsa and .ssh/id_ecdsa in newer ssh versions.

but your private key has an alternative name, so you need to use ssh with -i option

try to connect using this command ssh -vvv -i .ssh/key remoteserver

  • This is not a answer but suits better in the comment section. – OrangeTux Feb 27 '14 at 14:04
  • 1
    @OrangeTux: It was in the comment section (see askubuntu.com/questions/426971/… ) and it does solve the problem. I dare say it is an answer. – Piskvor Feb 27 '14 at 14:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.