Last active
February 8, 2016 14:30
-
-
Save kumekay/51c39b17d9d8c1820070 to your computer and use it in GitHub Desktop.
Reverse SSH tunnel with autossh started with upstart for ubuntu. Allows to connect to computer hidden behind NAT over SSH. Good replacement for vpn in some cases
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
# File: /etc/init/autossh.conf | |
# Start ssh tunnel after network for specified user | |
description "Start autossh reverse tunnel" | |
start on (local-filesystems and net-device-up IFACE=eth0) | |
stop on runlevel [016] | |
respawn | |
respawn limit 5 60 | |
exec autossh -M 0 -N -o "PubkeyAuthentication=yes" -o "PasswordAuthentication=no" -o "ServerAliveInterval 60" -o "ServerAliveCountMax 3" -o "StrictHostKeyChecking=no" -o "BatchMode=yes" -i /home/user/.ssh/id_rsa -R 5522:localhost:22 [email protected] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment