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 !

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.