Install Homebrew prereqs:
xcode-select --install
Install Homebrew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Enable Brew to override OSX system binaries
brew tap homebrew/dupes
brew install openssl
brew install openssh --with-brewed-openssl --with-keychain-support
Make a backup of original plist file:
sudo cp /System/Library/LaunchAgents/org.openbsd.ssh-agent.plist Desktop/
Edit the plist file:
sudo vim /System/Library/LaunchAgents/org.openbsd.ssh-agent.plist
Replace the following two lines:
<string>/usr/bin/ssh-agent</string>
<string>-l</string>
With this:
<string>/usr/local/bin/ssh-agent</string>
<string>-D</string>
Update the system to see the changes to the plist file:
launchctl unload /System/Library/LaunchAgents/org.openbsd.ssh-agent.plist
launchctl load -w /System/Library/LaunchAgents/org.openbsd.ssh-agent.plist
launchctl start org.openbsd.ssh-agent
launchctl list | grep org.openbsd.ssh
Backup the original binary:
sudo mv /usr/bin/ssh Desktop/
Create the symlink:
sudo ln -s /usr/local/bin/ssh /usr/bin/ssh
Add the following snipped to all users .bash_profile
file
eval $(ssh-agent)
function cleanup {
echo \"Killing SSH-Agent\"
kill -9 $SSH_AGENT_PID
}
trap cleanup EXIT
Reboot the system:
sudo shutdown -r now
Check that system is using the new SSH version
ssh -V
brew untap homebrew/dupes
https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/Installation.md
https://mochtu.de/2015/01/07/updating-openssh-on-mac-os-x-10-10-yosemite/
https://coderwall.com/p/qdwcpg/using-the-latest-ssh-from-homebrew-on-osx
http://www.dctrwatson.com/2013/07/how-to-update-openssh-on-mac-os-x/
http://blog.macromates.com/2006/keychain-access-from-shell/
http://www.lifeofguenter.de/2015/01/compile-openssh-67-with-libressl-on-osx.html
https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/security.1.html
Keychain is not supported anymore https://github.com/Homebrew/homebrew-dupes/pull/482#issuecomment-118994372