Tag Archives: mac

Using your keychain with ssh-add on macOS Sierra

You might have noticed that macOS Sierra doesn’t offer to store private key passphrases for SSH in your user keychain anymore. It doesn’t automatically add SSH identities from your keychain, either.

Result: you need to enter the passphrase for each of your SSH keys at least once per session, where previously you could enter it once and never type it again.

Given the security implications of making it too easy to open an SSH session without authenticating yourself, I can’t fault Apple for this. But if you’re a heavy SSH user, you might agree that it’s more painful to work with now.

Thankfully, there is a workaround. I’ve just added this to my ~/.profile file:

if [ "$USER" != "root" ]; then

    if ! ssh-add -l | grep -q 'id_rsa.lkrms'; then

        ssh-add -A

        if ! ssh-add -l | grep -q 'id_rsa.lkrms'; then

            ssh-add -K "$HOME/.ssh/Keys/id_rsa.lkrms"

        fi

    fi

fi

Now, every time I open a terminal, ssh-add -l is grepped for id_rsa.lkrms. If it’s missing, ssh-add -A is called to add SSH identities from my keychain. If id_rsa.lkrms still hasn’t appeared, I will be prompted for my passphrase, and it will be stored in my keychain for future use.

Installing Homebrew on El Capitan when SSL won’t give you a handshake

This is a tech post for tech people who like to tech out their Macs using Homebrew.

(With apologies to those who have no clue what I’m talking about.)

If you’re trying to do a clean install of Homebrew using the instructions on http://brew.sh, you’ll probably you might get this error:

curl: (35) Server aborted the SSL handshake

Apparently something is currently broken about accessing GitHub-hosted raw content via https://raw.githubusercontent.com. It’s probably nothing do with your curl version.

Here’s an alternate install command that worked for me:

/usr/bin/ruby -e "$(curl -fsSL https://github.com/Homebrew/install/raw/master/install)"

You’re welcome.

UPDATE: it’s possible I was experiencing this issue due to intermittent problems with Telstra’s network.

How to stop Photos.app opening whenever you connect a memory card

Yo Apple, Photos.app is really great and everything, but those of us who use third-party photo production software for ingestion and processing don’t want to see it EVERY TIME WE PLUG A MEMORY CARD INTO OUR MAC. (We don’t want to see it when we connect our iPhone, either. We only do that when Facebook Too Much Very Important Work has killed our phone battery.)

A user-friendly toggle to disable this for all devices would be super. Perhaps under System Preferences > CDs and DVDs?

Meanwhile, fellow photographers, here’s a terminal command that will safely disable the automatic opening of Photos.app when you least expect it. Copy and paste everything after the $ into Terminal.app and press Return:

$ defaults -currentHost write com.apple.ImageCapture disableHotPlug -bool YES

Unlike some of the other workarounds on the Internet, this one works even when you regularly re-format your memory cards (as most of us do). And it doesn’t require you to delete Photos.app, which might potentially break something somehow. No reboot required, either.

Update (27-Nov-15): If, for some reason, you want to reverse this change and return to OS X’s default behaviour, here’s the command to run:

$ defaults -currentHost delete com.apple.ImageCapture disableHotPlug