Brew SSH – How to Upgrade Brew SSH After Recent Client Exploit

homebrewmacosopensslssh

I'm running OS X El Capitan 10.11.1

Since the recently discovered SSH client exploit mentioned here I wanted to take action to secure myself. In the process I noticed I'm using Apple's ssh and not the brew version I have installed. So I wanted to change that. One of the things I need to do is edit the file below to point to /usr/local/bin/ssh-agent instead of the system default /usr/bin/ssh-agent. However, even as sudo, I cannot edit this file. It only opens as readonly.

sudo vi /System/Library/LaunchAgents/org.openbsd.ssh-agent.plist

How can I open this file in read/write mode?

Best Answer

To be able to modify certain directories/files in OS X El Capitan you have to disable System Integrity Protection (SIP) AKA “rootless”:

  1. Reboot your Mac into Recovery Mode by restarting your computer and holding down cmd+R until the Apple logo appears on your screen.
  2. In the menubar click Utilities > Terminal.
  3. In the Terminal window, type in csrutil disable.
  4. Restart your Mac.
  5. After finishing your mods re-enable it in Recovery Mode with csrutil enable.

The file /System/Library/LaunchAgents/org.openbsd.ssh-agent.plist may be replaced in the next system update.