Fix for Mac 10.5.5 ssh, scp, sftp

The 10.5.5 update for Mac has appar­ently bro­ken ssh. Until Apple fixes this, the best option seems to be to com­pile a patched ver­sion of OpenSSH. I’ve writ­ten this script to auto­mate the down­load­ing, com­pi­la­tion, and alias­ing. This process leaves the exist­ing ssh intact, but aliases the ssh, scp, and sftp com­mands to the newer work­ing ver­sions.  When Apple does release a fix, just remove the alias lines in your ~/.bash_login file to use the orig­i­nal version.

Impor­tant!

Please note that this script gen­er­ate a LOT of files dur­ing the com­pi­la­tion. Cre­ate a tem­po­rary direc­tory and exe­cute this script from there. That way you eas­ily delete the whole mess when you’re done.

fix_openssh source

#!/usr/bin/env ruby -w

`curl -O ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-5.1p1.tar.gz`
`tar -zxvf openssh-5.1p1.tar.gz`
`openssh-5.1p1/configure`
`cd openssh-5.1p1 & make`
`cd openssh-5.1p1 & sudo make install`
`echo "#fix ssh bug in 10.5.5... temporarily change this to /opt/local/bin/ssh" >> ~/.bash_login`
`echo "alias ssh='/opt/local/bin/ssh'" >> ~/.bash_login`
`echo "alias ssh='/opt/local/bin/scp'" >> ~/.bash_login`
`echo "alias ssh='/opt/local/bin/sftp'" >> ~/.bash_login`

I know—there’s really noth­ing Ruby about this. I guess it could just be a shell script.

Update 10/10/08

My machine installs files to /opt/local/bin/, but it appears that on most Macs, it’ll install your new bina­ries to /opt/local/bin/. If this is that case on yours, just change the alias path in your ~/.bash_login.

Comment on this post

You may use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>