Using Existing SSH KeysΒΆ

  1. Place the existing key under ~/.ssh/ folder on NodeZero.

  2. Create .ssh directory on NodeOne and NodeTwo using the following command for each node:

    ssh <user>@<node> mkdir -p .ssh
    
  3. Upload the generated public key to NodeOne and NodeTwo using the following command for each node:

    cat ~/.ssh/id_rsa.pub | ssh <user>@<node> 'cat >> .ssh/authorized_keys'
    
  4. Set permissions for the .ssh directory and uploaded public key file on NodeOne and NodeTwo using the following command on each node:

    ssh <user>@<node> "chmod 700 .ssh; chmod 640 .ssh/authorized_keys"