Copy your ssh public key to a server from a machine that doesn’t have ssh-copy-id (E.g. MacOS)

ssh-copy-id is ace, but it when it doesn’t exist, the following will come handy:

cat ~/.ssh/id_rsa.pub | ssh $USER@example.com "cat >> ~/.ssh/authorized_keys"

Note: just change the “example.com” address to that of your server.

Tagged with:

Leave a comment

Note: Please be excellent (this is not YouTube and I reserve the right not to publish comments from muppets.) Your email address will not be published. Required fields are marked *