Last active
December 6, 2022 07:59
-
-
Save lenciel/d353a04a3a7bc0278ec6 to your computer and use it in GitHub Desktop.
autossh plist file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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>KeepAlive</key> | |
<true/> | |
<key>Label</key> | |
<string>autossh.lenciel</string> | |
<key>ProgramArguments</key> | |
<array> | |
<string>/opt/boxen/homebrew/bin/autossh</string> | |
<string>-M</string> | |
<string>20000</string> | |
<string>-f</string> | |
<string>-i</string> | |
<string>~/.ssh/fuckgfw</string> | |
<string>-N</string> | |
<string>-L</string> | |
<string>0.0.0.0:3189:localhost:31280</string> | |
<string>remotehost</string> | |
</array> | |
<key>RunAtLoad</key> | |
<true/> | |
<key>WorkingDirectory</key> | |
<string>/opt/boxen/</string> | |
<key>StandardErrorPath</key> | |
<string>/opt/boxen/log/autossh/autossh.log</string> | |
</dict> | |
</plist> |
Thanks a lot for sharing it!
In my case, I had to remove -f from the options.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is a plist file for starting autossh automatically after you login to your Mac.
To use:
Install autossh
Ensure you have passwordless ssh between yourself and your remote server
Change
/opt/boxen/homebrew/bin/autossh
to the output ofwhich autossh
Change the string after
-i
(it isfuckgfw
now) to your private key file name if you haveChange the string
remotehost
to the host which save your assModify the logging related configuration if you don't use boxen . Or remove the block completely if you don't want to see any log
Copy the above gist to ~/Library/LaunchAgents/autossh.lenciel.plist
Ask OSX to launch autossh every time you log in:
After this you might need to setup your browser or tell OSX to use the encrypted connection globally by : System Preferences ➡ Network ➡ Advanced ➡ Proxies
Change at least the Web Proxy (HTTP), Secure Web Proxy (HTTPS), and FTP Proxy entries and enjoy it.