Last active
January 30, 2018 02:03
-
-
Save icchy/b84dc0d46441c8a899c237ee793814d1 to your computer and use it in GitHub Desktop.
persistent reverse port forward with systemd
This file contains hidden or 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
[Unit] | |
Description = SSH daemon for rescure | |
After = network.target | |
[Service] | |
ExecStart = /usr/bin/ssh \ | |
-N \ | |
-o "ExitOnForwardFailure=yes" \ | |
-o "StrictHostKeyChecking=no" \ | |
-o "UserKnownHostsFile=/dev/null" \ | |
-o "ServerAliveInterval 60" \ | |
-o "ServerAliveCountMax 3" \ | |
-R 12345:127.0.0.1:22 host | |
Restart = always | |
Type = simple | |
User = user | |
[Install] | |
WantedBy = multi-user.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment