Skip to content

Instantly share code, notes, and snippets.

@chengscott
Created October 27, 2022 11:54
Show Gist options
  • Save chengscott/dfc8795fd48d3f3dfcd0c740efa1e395 to your computer and use it in GitHub Desktop.
Save chengscott/dfc8795fd48d3f3dfcd0c740efa1e395 to your computer and use it in GitHub Desktop.
[Unit]
Description=Reverse SSH connection
After=network.target
[Service]
Type=simple
ExecStart=/usr/bin/ssh -N -T -o "ServerAliveInterval 10" -o "ExitOnForwardFailure yes" -R 2222:localhost:22 chengscott@host
Restart=always
RestartSec=5s
[Install]
WantedBy=default.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment