login about faq

Hi, I face a problem about key pair. For example, there are 3 servers.(server_A,server_B and server_C). I generated a key pair on server_A and added public key to server_B. Server_A could login server_B via key-based login authentication. The question is if I add the private key which is generated on server_A into server_C , Could server_C login the server_B? Thanks a lot !

asked Sep 18 '12 at 06:04

Rod's gravatar image


Hello, the answer is yes. SSH user keys do not have dependencies with the underlying operating system and therefore you can copy keys from machine to another.

However, the preferred way here is that you would create a completely new key pair on the server_C, and that you would then add that new created public key file into server_B. Typically you shouldn't transfer private key files across networks (or send them unprotected via emails etc).

Finally, SSH has a special feature called agent forwarding, which allows you to get Single-Sign-On (SSO). In agent forwarding, you will just copy your .pub key file from your workstation to all target SSH servers, and, after you have enabled agent forwarding from the client and from the SSH servers, you can hop from SSH server to another using key authentication (workstation -> SSHserverA -> SSHserverB -> SSHserverC). Agent forwarding will simplify key setup when you need to hop from machine to another. This is typically used when people are doing server management a in trusted server environment.

Hopefully this helps!

Regs, SamiM


answered Oct 18 '12 at 03:48

Sami%20Marttinen's gravatar image

Sami Marttinen ♦


answered Oct 24 '12 at 11:31

savannah001's gravatar image


Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: Sep 18 '12 at 06:04

Seen: 5,791 times

Last updated: Oct 24 '12 at 11:31

All user contributed content licensed under the cc-by-sa license.
Powered by OSQA.