I needed to specify the full path to ssh
, otherwise I saw issues. This is probably because my ssh
is custom from MacPorts.
The M
flag is master mode for connection sharing. The N
flag means to send no commands, only connect.
To load this into launchd, run
launchctl load name.henriknyh.controlmaster.plist
from that directory (otherwise specify the full path). Then run
launchctl start name.henriknyh.controlmaster
to start it immediately, without waiting for next boot.
And that's it. Pretty complicated, but very useful, and easy to use once it's set up.