ssh-copy-id on Mac OSX, the manual way

On linux enviroment, you normally have the command ssh-copy-id to add you public key to the remote server, using a command like:

ssh-copy-id user@the_host_to_connect

After you type the password, you wont be required to enter password again the ext time you connect to the host via SSH.

But what happen when you don’t have this command, like for example on IE? For this case you can use the following instructions:

cat ~/.ssh/ | ssh user@the_host_to_connect "mkdir ~/.ssh; cat >> ~/.ssh/authorized_keys"