For work, I have been given a new Macbook Pro 13″ running Mac OS X version 10.11.6, also known as El Capitan.
I was missing my ssh-agent notifications on this new mac (see links below), so it’s time to replay my recipe wherein I patch Apple’s OpenSSH to integrate support for Notification Center.
Original article:
http://devinteske.com/wp/ssh-agent-notifications-osx/
Update to original:
http://devinteske.com/wp/replay-mac-os-x-and-native-ssh-agent-notifications/
However, things have changed slightly in El Capitan, so we’ll explore a new set of instructions to simplify the process.
How to patch Apple’s OpenSSH on El Capitan to support native Notification Center in 16 steps (El Capitan specific changes highlighted in red):
REMINDER: You can browse Apple’s open source repository at https://opensource.apple.com/
- Disable System Integrity Protection using Apple SIP Guide
- Open Terminal.app
- curl -LO https://opensource.apple.com/tarballs/OpenSSL098/OpenSSL098-59.60.1.tar.gz
- tar zxf !$:t
- sudo cp -R !$:r:r/src/include/openssl /usr/local/include/
- curl -LO https://opensource.apple.com/tarballs/OpenSSH/OpenSSH-195.40.1.tar.gz
- tar zxf !$:t
- cd !$:r:r/openssh
- curl -L https://github.com/devinteske/apple/commit/f13a501678ed79bb9511828423e754df344e3bf0.patch -o patch.txt
- patch -N < !$
- ./configure --with-pam --with-audit=bsm
- make
- sudo cp -avf /usr/bin/ssh-agent{,.orig}
Note: This step requires SIP to be disabled - sudo cp ssh-agent /usr/bin/ssh-agent
Note: This step requires SIP to be disabled - killall ssh-agent
- ssh some-host
Note: If you’re just using ~/.ssh/id_rsa and haven’t added the key to your keychain, no notification will appear and you will have to execute “ssh-add -K ~/.ssh/id_rsa” (without quotes; make sure to use capital-K) to add the key to your keychain. - Optional: Re-enable SIP using Apple SIP Guide
Now every subsequent ssh request that uses a key stored in your keychain will cause a notification to appear in Apple’s built-in Notification Center. Cheers!