Fix for Mac 10.5.5 ssh, scp, sftp
The 10.5.5 update for Mac has apparently broken ssh. Until Apple fixes this, the best option seems to be to compile a patched version of OpenSSH. I’ve written this script to automate the downloading, compilation, and aliasing. This process leaves the existing ssh intact, but aliases the ssh, scp, and sftp commands to the newer working versions. When Apple does release a fix, just remove the alias lines in your ~/.bash_login file to use the original version.
Important!
Please note that this script generate a LOT of files during the compilation. Create a temporary directory and execute this script from there. That way you easily 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 nothing 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 binaries to /opt/local/bin/. If this is that case on yours, just change the alias path in your ~/.bash_login.
Comment on this post