Created
November 11, 2024 14:42
-
-
Save mortie/e5e8b487115b0fcd369495afda91fb39 to your computer and use it in GitHub Desktop.
SSH service for creating a reverse SSH tunne
This file contains 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=Create reverse SSH tunnel | |
[Service] | |
User=martin | |
ExecStart=/usr/bin/autossh -N -T -o 'ServerAliveInterval 10' -o 'ServerAliveCountMax 2' -R 0.0.0.0:<SERVER PORT>:localhost:22 <SERVER> | |
Restart=always | |
RestartSec=5s | |
[Install] | |
WantedBy=network-online.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Depends on autossh:
apt install autossh