Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My scenario is this, I am trying to SCP from server1 to server2 and and I need to create a public_key on server1 to allow server2 access to it. How do I do this?

share|improve this question
up vote 1 down vote accepted
  1. login server1 with the user, which will scp files.
  2. ssh-keygen -t rsa
  3. ssh-copy-id <user>@server2
  4. Test if you can ssh from server1 to @server2
  5. Done.
share|improve this answer

the internet is full of answers to your question. On unix like machines, google for keyword. ssh-keygen, running that command for example as : ssh-keygen -t rsa on server 1 will give you two files id_rsa and You save id_rsa into your $HOME/.ssh and you copy to server2:$HOME/.ssh/authorized_keys. Make sure the permission are 0600.

Nonetheless I did a quick google just to see what you would find on the topic and here is 1 which takes the case where your server 1 may be windows as well. :

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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