0

At my work I have to ssh into our development server.

I used my windows partition to provide an ssh which they added to their authentication list. But now that I have my Linux partition up and running I wanted to add that. Now after speaking with them they only want to have my 1 ssh key set on the server so I would have to add that same key to my Ubuntu 16.04 partition.

I've tried bringing the id_rsa and id_rsa.pub files over and attempting to ssh into the server but to no avail.

I simply copied the id_rsa and id_rsa.pub files to an email and sent to myself and placed in a directory home/keys. I'm sure this is not the correct location to place them but I do not know how to access the ssh directory on ubuntu.

Is there a way to add these files to my ssh directory on Ubuntu? or if that would fix the issue?

I know I can create new ssh keys but that defeats the purpose of what I am trying to do.

Any help is greatly appreciated, thank you.

5
  • What is "an ssh"? Do you mean an ssh key? How did you try bringing id_rsa and id_rsa.pub? What commands did you run? Where did you save the files? – terdon Jul 28 '16 at 13:51
  • Yes, adding an ssh key from my windows OS to my ubuntu OS. I simply copied the id_rsa and id_rsa.pub files to an email and sent to myself and placed in the directory home/keys. I'm sure this is not the correct location to place them but I do not know how to access the ssh directory on ubuntu. – Alkarin Jul 28 '16 at 13:55
  • OK. Please edit your question and add this information. – terdon Jul 28 '16 at 13:56
  • You shouldn't move the private key around! – spacelander Jul 28 '16 at 13:57
  • If by "Windows SSH key file" you mean a PuTTY .ppk private key file, then you can convert that to an OpenSSH compatible id_rsa file by loading it into puttygen and selecting 'Export OpenSSH key' from the 'Conversions' menu – steeldriver Jul 28 '16 at 15:57
2

Both files should be placed in the directory /home/{user}/.ssh, if you find this directory doesn't exist, you can make it with the correct permission with the command:

mkdir -m700 ~/.ssh

Move both the public and private keyfiles into that directory (using the directory /home/keys that you wrote in your question):

mv /home/keys/id_rsa* ~/.ssh

Make sure that the keys have the correct permissions and ownership:

chown {user}:{user} ~/.ssh/id_rsa*
chmod 600 ~/.ssh/id_rsa
chmod 644 ~/.ssh/id_rsa.pub
2
  • 2
    My reading of the OP was that he had already provided his public key to whoever administers the server, and that he wanted the same private key on both partitions of his dual-boot machine because the admin(s) refused to allow access via two different keys. – user4556274 Jul 28 '16 at 14:08
  • Yeah that makes total sense now. May edit or delete this question, just going to research whether there's a command that'll make the ~/.ssh directory and install the keys with correct permissions. – Arronical Jul 28 '16 at 14:11
0

The usual location for your RSA private key is ~/.ssh/id_rsa. Neither the key nor the containing directory should be group or world readable.

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.