SSH Quick guide to Keyless setup

SSH

A great way to connect to machines

Keyless

Generate

ssh-keygen -t rsa

Thats it !!!

Copy the Keys

Standard

There are 2 ways - the simple (assuming everything is standard ie ssh ports)

ssh-copy-id user@123.45.56.78

When you log into the remote machine - a trust is created - allowing you to log in again without specifying a password

Non Standard

Should the ssh be used with a special port, cipher etc - then the Standard way will not work.

So instead you need to manually (1 Line !!) do this

    cat ~/.ssh/id_rsa.pub | ssh -p 34890 user@remote.com  "mkdir -p ~/.ssh && cat >>  ~/.ssh/authorized_keys"

SSH A command

This now becomes

   ssh user@remote "df -kh"

No waiting no fuss. Great for Scripting.