I have generated private and public key pair files (id_rsa, id_rsa.pub) using ssh-keygen command in a machine A, which is a client. I have tested my connection to server in machine A and it is working fine. Now I have copy those files using cp command to a machine B (~/.ssh folder) and I can't login anymore. Once I deleted my public key file, I can successfully login into server. However, my X2goclient can't connect and prompt up multiple times the paraphrase window with and without the public key.

What is the adequate procedure to copy those keys from client to client (Machine A to Machine B)?


  • ensure that file permissions are correct. (cp -a) – kofemann Oct 9 '19 at 20:29
  • the permissions for id_rsa are 600 and for id_rsa.pub are 644 – Jorge Johanny Sáenz Noval Oct 9 '19 at 20:54

According to my understanding, I don't think your problem lies with key generation but with installation of your key on Machine B. Instead of using cp use following command for copying

ssh-copy-id -i ~/.ssh/home/rsapath user@host

First you have to enter server login password (not your RSA password). Once the keys are added, login into your sever using

ssh 'user@host'

Enter RSA password here. Hope this solution helps.

| improve this answer | |

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.