Wednesday, August 27, 2014

Automating Passwordless Access

Assuming you have generated rsa keys (ssh-keygen) and assuming that ssh-copy-id is NOT working for you...

Here's the command:
cat ~/.ssh/id_rsa.pub | ssh -p 22 <login>@<dest> "cat >> .ssh/authorized_keys";
Where <login> is your username and <dest> is the server to which you're sending the public key.

OR, if you do this often, create passwordless.sh:

To run it:
chmod +x passwordless.sh
./passwordless.sh <login> <dest>

No comments :

Post a Comment