Skip to content

Instantly share code, notes, and snippets.

@coryt
Forked from venj/com.yourcompany.autossh.plist
Created October 20, 2016 14:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save coryt/75e7004c8f403238735248baf7ceb20f to your computer and use it in GitHub Desktop.
Save coryt/75e7004c8f403238735248baf7ceb20f to your computer and use it in GitHub Desktop.
Put following gist to ~/Library/LaunchAgents, and then run: launchctl load /Users/your_name/Library/LaunchAgents/com.yourcompany.autossh.plist
<?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>OnDemand</key>
<false/>
<key>KeepAlive</key>
<true/>
<key>RunAtLoad</key>
<true/>
<!-- Contains a unique string that identifies your daemon to launchd.
This key is required. -->
<key>Label</key>
<string>com.yourcompany.autossh</string>
<!-- Contains the arguments [to exec()] used to launch your daemon.
This key is required. -->
<key>ProgramArguments</key>
<array>
<!--split your command. My command is:
/usr/local/bin/autossh -M 20000 -f -N -p 443 -g -C -c 3des -D 7070 name@you.ssh.server
change to your own.
-->
<string>/usr/local/bin/autossh</string>
<string>-M</string>
<string>20000</string>
<string>-f</string>
<string>-N</string>
<string>-p</string>
<string>443</string>
<string>-g</string>
<string>-C</string>
<string>-c</string>
<string>3des</string>
<string>-D</string>
<string>7070</string>
<string>name@you.ssh.server</string>
</array>
<!-- low priority -->
<key>Nice</key>
<integer>20</integer>
<key>LowPriorityIO</key>
<true/>
</dict>
</plist>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment