Skip to content

Instantly share code, notes, and snippets.

@tianchaijz
Created October 17, 2018 14:38
Show Gist options
  • Save tianchaijz/569b53d5247806f5f6d587c948ddbeb6 to your computer and use it in GitHub Desktop.
Save tianchaijz/569b53d5247806f5f6d587c948ddbeb6 to your computer and use it in GitHub Desktop.
[Unit]
Description=ssh forwarding
After=network.target
[Service]
Type=simple
ExecStart=/usr/bin/ssh -N -o ServerAliveInterval=60 -o StrictHostKeyChecking=no -R 0.0.0.0:2922:127.0.0.1:22 x@y -p 22
Restart=on-failure
[Install]
# After=graphical.target
# WantedBy=multi-user.target
WantedBy=graphical.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment