Skip to content

Instantly share code, notes, and snippets.

@omartrigui
Last active February 16, 2018 18:59
Show Gist options
  • Save omartrigui/05bfc84f9abaf34e7d59c5a4ca31fa2f to your computer and use it in GitHub Desktop.
Save omartrigui/05bfc84f9abaf34e7d59c5a4ca31fa2f to your computer and use it in GitHub Desktop.
Bind local port to remote port with SSH
# Server
sudo echo -e "Match User username\n GatewayPorts yes" >> /etc/ssh/sshd_config
service ssh restart
# Client
ssh -i ~/path/private/key -R 9876:localhost:8000 -N [email protected]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment