Created
February 14, 2025 19:06
-
-
Save bukowa/8d8bfa68dfda2f3b748db5ea79cca265 to your computer and use it in GitHub Desktop.
sshd reverse tunnel proxy
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
# pc | |
[Unit] | |
Description=AutoSSH tunnel for PC1 to EC2 | |
After=network.target | |
[Service] | |
User=buk | |
ExecStart=/usr/bin/autossh -i /home/buk/.ssh/ec2.pem -M 0 -N -R 2222:localhost:22 ec2-user@<ip> -o ServerAliveInterval=60 -o ServerAliveCountMax=3 -o ExitOnForwardFailure=yes | |
Restart=always | |
RestartSec=1min | |
[Install] | |
WantedBy=multi-user.target |
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
# ec2 | |
AllowTcpForwarding yes | |
GatewayPorts yes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment