First generate you ssh key on your local machine

ssh-keygen -t rss

Install ssh-copy-id

sudo brew install ssh-copy-id

or

sudo curl https://raw.githubusercontent.com/beautifulcode/ssh-copy-id-for-OSX/master/ssh-copy-id.sh -o /usr/local/bin/ssh-copy-id sudo chmod +x /usr/local/bin/ssh-copy-id

Second, let’s copy the key to your remove server.

ssh-copy-id -i ~/.ssh [email protected]

References: http://www.jacobtomlinson.co.uk/2013/01/24/ssh-copy-id-os-x/

Done!