Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
add comment

2 Answers

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
add comment

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 id_rsa.pub. You save id_rsa into your $HOME/.ssh and you copy id_rsa.pub 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. : http://www.mtu.net/~engstrom/ssh-agent.php

share|improve this answer
add comment

Your Answer

 
discard

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.