Adding ssh-id-copy to OSX !

There’s a very convenient shell script bundled with some distributions of OpenSSH called ssh-copy-id. It seems not to be the case with Leopard’s or Lion’s SSH.
In order to get it, we can simply check it out of a GIT repository. Execute these two commands:

sudo curl '' -o /usr/bin/ssh-copy-id
sudo chmod +x /usr/bin/ssh-copy-id

Now execute ssh-id-copy like this:

MBP:~ martijn$ ssh-copy-id root@
Now try logging into the machine, with "ssh 'root@'", and check in:


to make sure we haven't added extra keys that you weren't expecting.

2 thoughts on “Adding ssh-id-copy to OSX !

  1. Ehy, I wasn’t aware of this! It’s about time to retire the following kludge:

    cat .ssh/ | ssh root@ ‘mkdir .ssh; chmod 700 .ssh; cat >> .ssh/authorized_keys2; chmod 600 .ssh/authorized_keys2’

    Good find Martijn!


Leave a Reply

Your email address will not be published. Required fields are marked *