Created
February 28, 2020 10:40
-
-
Save royvandam/f7b08d9b6fcf84cd80644f2c7d5e192b to your computer and use it in GitHub Desktop.
Auto-starting reverse SSH proxy using systemd service file
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] | |
AssertPathExists=/home/${user}/.ssh/id_rsa | |
After=network.target | |
[Service] | |
User=${user} | |
WorkingDirectory=/ | |
ExecStart=/usr/bin/ssh -vvv -N -T \ | |
-R 0:localhost:22 \ | |
-o PasswordAuthentication=no \ | |
-o IdentityFile=/home/${user}/.ssh/id_rsa \ | |
-o TCPKeepAlive=yes \ | |
-o ServerAliveInterval=300 \ | |
-o ServerAliveCountMax=2 \ | |
${user}@${host} | |
Restart=always | |
RestartSec=30 | |
[Install] | |
WantedBy=default.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment