SSH key exchange

1. Create your public and private keys on server A
ssh-keygen -t rsa
- Generating public/private rsa key pair.
- Enter file in which to save the key (/home/flopy/.ssh/id_rsa):
- Enter passphrase (empty for no passphrase):
- Enter same passphrase again:
- Your identification has been saved in /home/flopy/.ssh/id_rsa.
- Your public key has been saved in /home/flopy/.ssh/id_rsa.pub.
- The key fingerprint is:
xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx flopy@servera
OBS: Do not enter a passphrase, just hit enter
2. Create your public and private key on server B
ssh-keygen -t rsa
- Generating public/private rsa key pair.
- Enter file in which to save the key (/home/flopy/.ssh/id_rsa):
- Enter passphrase (empty for no passphrase):
- Enter same passphrase again:
- Your identification has been saved in /home/flopy/.ssh/id_rsa.
- Your public key has been saved in /home/flopy/.ssh/id_rsa.pub.
- The key fingerprint is:
xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx flopy@servera
3. Copy the public key from /home/username/.ssh/id_rsa.pub from serverA to a file called /home/username/.ssh/authorized_keys2 on serverB
4. Copy the public key from /home/username/.ssh/id_rsa.pub from serverB to a file called /home/username/.ssh/authorized_keys2 on serverA

Leave a comment