rsync -av -e "ssh -p 2222" ~/.ssh/id_dsa.pub [email protected]:.ssh/authorized_keys
This adds the public key to the authorized_keys file in your ~/.ssh directory on the remote machine. You can specify a port other than 22 with -p####.
You can also copy the ssh key to the clipboard and manually add to authorized_keys on the remote machine while logged via SSH:
pbcopy < ~/.ssh/id_dsa.pub
Copy and paste from Linux:
and in ~/.ssh/config locally:
#Devbox Host ShortName HostName targetDomain.com PreferredAuthentications publickey IdentityFile ~/.ssh/id_dsa User mark