1

I want to start the following command as a service on Mac OS X. Could anybody show me what is the correct way to do it on Catalina? Thanks.

ssh -D 1337 -q -C -N -f [email protected]

https://ma.ttias.be/socks-proxy-linux-ssh-bypass-content-filters/

1 Answer 1

-1

Here is an example using autossh, registered as a launchd service.

<?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>swinton.autossh</string>
 <key>KeepAlive</key>
 <dict>
  <key>NetworkState</key>
  <true/>
 </dict>
 <key>RunAtLoad</key>
 <true/>
 <key>ProgramArguments</key>
 <array>
     <string>/usr/local/bin/autossh</string>
     <string>-M</string>
     <string>20000</string>
     <string>-D</string>
     <string>9999</string>
     <string>[email protected]</string>
     <string>-N</string>
 </array>
 <key>StandardOutPath</key>
 <string>/Users/steve/Logs/autossh/autossh.stdout</string>
 <key>StandardErrorPath</key>
 <string>/Users/steve/Logs/autossh/autossh.stderr</string>
 <key>User</key>
 <string>steve</string>
 <key>ThrottleInterval</key>
 <integer>30</integer>
</dict>
</plist>

Some launchd documentation can be found here: https://www.launchd.info/

3
  • Where does autossh come from, how does it need to be configured?
    – nohillside
    Commented Feb 3, 2022 at 10:28
  • I did brew install autossh but it doesn't really matter where it comes from. It does not need any configuration. It's just a wrapper around ssh.
    – Albert
    Commented Feb 3, 2022 at 10:47
  • Might be worth to explain this in the answer.
    – nohillside
    Commented Feb 3, 2022 at 10:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .