Generate a key on your local machine
ssh-keygen -t dsa
or
ssh-keygen -t rsa -b 4096
hit enter at the prompts and specifying a strong password
Copy the key to a remote machine
cat .ssh/id_dsa.pub | ssh username@hostname 'cat >> .ssh/authorized_keys'
or
cat .ssh/id_rsa.pub | ssh username@hostname 'cat >> .ssh/authorized_keys'
This should work whether you’re using Cygwin on Windows, Mac OS X, or some flavor of Linux