SSH keys and uploading to remote server

Updated May 31st, 2016
If you don't already have a folder named .ssh, create it, add it, and secure its permissions as follows:
mkdir ~/.ssh
chmod 700 ~/.ssh
Then generate private/public key pair:
# 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
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
ssh-copy-id -i ~/.ssh/id_rsa2.pub [remote server]
or if you are on MacOSX or something that doesn't have ssh-copy-id, use:
cat ~/.ssh/id_rsa2.pub | ssh [remote server] "cat >> ~/.ssh/authorized_keys"

Internal References

Article Type

General