Skip to content

Instantly share code, notes, and snippets.

@dpoggi
Last active December 11, 2022 00:00
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dpoggi/17ee34980232826acb35 to your computer and use it in GitHub Desktop.
Save dpoggi/17ee34980232826acb35 to your computer and use it in GitHub Desktop.
launchd plist for Homebrewed autossh (local tunnel)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>homebrew.mxcl.autossh</string>
<key>KeepAlive</key>
<true/>
<key>RunAtLoad</key>
<true/>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/autossh</string>
<!-- autossh switches -->
<string>-M</string>
<string>0</string>
<!-- ssh switches -->
<string>-N</string>
<string>-o</string>
<string>ControlMaster no</string>
<string>-o</string>
<string>ServerAliveInterval 60</string>
<string>-o</string>
<string>ServerAliveCountMax 3</string>
<string>-p</string>
<string>22</string>
<string>-l</string>
<string>remoteuser</string>
<string>-i</string>
<string>/path/to/ssh/identity/file</string>
<string>-L</string>
<string>8080:localhost:80</string>
<string>your.server.com</string>
</array>
</dict>
</plist>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment