Leopard, SSH-agent, and a macports gotcha
May 19th, 2008
So you're using ssh keys for all your servers and github and whatnot, and you've been using SSHKeychain in OS X 10.4, to manage that, and not type your password in all the time (SSHKeychain is a gui for ssh-agent).
Now that you're on Leopard, this all Just Works. No need for SSHKeychain (although SSHKeychain does other things too), and everything is nicely integrated with Mac OS keychain services. There's a nice write up over here at Ormset i Noreg. Buried in the comments, Luke Redpath notes that macports users might not be seeing this coolness, as OpenSSL is a dependency of some common ports (like git), and so the macport's ssh is not compiled with the leopard funkiness.
To fix this (assuming a standard macports install):
sudo mv /opt/local/bin/ssh /opt/local/bin/ssh-macports sudo mv /opt/local/bin/scp /opt/local/bin/scp-macports
Now, when you next push to github, or deploy to a server, you'll get something like this:
Hooray!
mogden Says:
Thanks for the tip, this was bugging me.September 5th, 2008 at 07:06 AM
Snork Says:
February 7th, 2009 at 03:19 PM
Actually, if you just do this, once
/usr/bin/ssh user@example.com
replacing user@example.com as appropriate, it’ll popup and ask you if you want to “remember password in my keychain”.
From then on, you can continue to use the macports supplied ssh binaries in /opt/local/bin/ssh etc, and they will use your key as supplied my the ssh-agent.
Put another way, the only step that is missing from the macports ssh tools is adding your key, and this only needs to be done once. After that, the macports ssh tools are very capable of using any key you’ve added.