Skip to content

Instantly share code, notes, and snippets.

@paulwinex
Last active October 16, 2018 12:10
Show Gist options
  • Save paulwinex/c5d48c4952581233c90535ca64fa8a10 to your computer and use it in GitHub Desktop.
Save paulwinex/c5d48c4952581233c90535ca64fa8a10 to your computer and use it in GitHub Desktop.
# on remove server
echo "GatewayPorts yes" >> /etc/ssh/sshd_config
systemctl restart sshd
# on local
ssh -R 9000:localhost:9000 [email protected]
# alias
alias tnl='f(){ ssh -R "$1:localhost:$1" [email protected]; unset -f f; }; f'
# usage
tnl user@server 9000
# autossh
http://www.harding.motd.ca/autossh/
autossh -M 20000 -f -N your_public_server -R 9000:localhost:22 -C
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment