I have accounts on two machine: H1 and H2. I created ssh keys on H1 and installed it on S1. I can now ssh to S1 from H1. I want to do the same from H2. How do I install the ssh keys generated on H1 on H2?
migrated from stackoverflow.com Sep 6 '11 at 15:42
|
You need to copy your private keys from H1 to H2, if you want to use your private keys to be able to login from H2 to S1. When you at H1 do the commands:
Warning! This will delete and replace any private key you have at H2. Or you can generate new private keys on H2 and install their public part on S1 with ssh-copy-id. In second case you will have two sets of keys; one is for H1-S1 login and second for H2-S1 login. There will be two public keys authorized at S1. And you will be able to revoke any of them or both. |
||||
|
|
|
Use SYNOPSIS
DESCRIPTION
|
|||||
|
|
Would ssh-copy-id do the job for you: http://linux.die.net/man/1/ssh-copy-id? |
|||||||||
|
|
LocalUser is Lu , and RemoteUser is Ru. Lu$ mkdir ~/.ssh Lu$ scp usernameOfRu@ipOfRu:.ssh/* .ssh/* usernameOfRu@ipOfRu's password: "Enter password of remote system" |
|||
|
|