Nov 19th, 2012
Updated May 31st, 2016
If you don't already have a folder named .ssh, create it, add it, and secure its permissions as follows:
Then generate private/public key pair:
It will prompt you to choose a password and to choose a filename.
Choose a strong password. It's ok to name it something other that id_rsa.pub
In this example, the name of the file is ~/.ssh/id_rsa2.pub
or if you are on MacOSX or something that doesn't have ssh-copy-id, use:
mkdir ~/.ssh chmod 700 ~/.ssh
# Acquia cloud requires a 4096 bit key ssh-keygen -t rsa -b 4096 ssh-add ~/.ssh/the_name_of_the_key #if you used a password, then you need to use the following which will prompt for password: ssh-add -K ~/.ssh/the_name_of_the_key
Choose a strong password. It's ok to name it something other that id_rsa.pub
In this example, the name of the file is ~/.ssh/id_rsa2.pub
ssh-copy-id -i ~/.ssh/id_rsa2.pub [remote server]
cat ~/.ssh/id_rsa2.pub | ssh [remote server] "cat >> ~/.ssh/authorized_keys"