Passwordless SSH between two machines using certificates

I’ve been meaning to post this somewhere useful for a while now, so here it is.

Assumption

Machine A wants to connect with SSH without passwords (with cert) to Machine B

Method

On Machine A:

[bash]
ssh-keygen

[/bash]

Make sure you pick no pass phrase.

[bash]
scp .ssh/id_rsa.pub user@machineb:.ssh/id_rsa.tmp

[/bash]

On Machine B:

[bash]

cat id_rsa.tmp >> authorized_keys
chmod 600 authorized_keys

[/bash]

Connect as normal from machine A to machine B

Comments

One response to “Passwordless SSH between two machines using certificates”

  1. After you generate your keys, you can save some typing by doing:

    ssh-copy-id user@machineb

    … then just type in your password for the last time, and it will add your public key to the remote account authorized_keys file.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.