Skip to content

Instantly share code, notes, and snippets.

@icchy
Last active Jan 30, 2018
Embed
What would you like to do?
persistent reverse port forward with systemd
[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