Skip to content

Instantly share code, notes, and snippets.

@slank
Last active June 23, 2016 10:00
Show Gist options
  • Save slank/df395a38ae26149f17c2 to your computer and use it in GitHub Desktop.
Save slank/df395a38ae26149f17c2 to your computer and use it in GitHub Desktop.
Launchd Config for on-demand SSH tunnel
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.openssh.port-forwards</string>
<key>OnDemand</key>
<true/>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/ssh</string>
<string>-C</string>
<string>-o ControlMaster=auto</string>
<string>-o ControlPath=#### SOMEPATH ####</string>
<string>-o ControlPersist=16</string>
<string>-o ServerAliveCountMax=2</string>
<string>-o ServerAliveInterval=5</string>
<string>-W localhost:#### ZNC PORT ####</string>
<string>#### HOSTNAME ####</string>
</array>
<key>Sockets</key>
<dict>
<key>Listeners</key>
<dict>
<key>SockServiceName</key>
<string>#### LOCAL LISTEN PORT ####</string>
<key>SockType</key>
<string>stream</string>
</dict>
</dict>
<key>inetdCompatibility</key>
<dict>
<key>Wait</key>
<false/>
</dict>
<!--
<key>StandardErrorPath</key>
<string>/tmp/org.openssh.port-forwards.launchd.err</string>
-->
</dict>
</plist>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment