Skip to content

Instantly share code, notes, and snippets.

@scottopell
Created August 12, 2016 14:50
Show Gist options
  • Save scottopell/5038ed75213755fcc49fe949366c6c23 to your computer and use it in GitHub Desktop.
Save scottopell/5038ed75213755fcc49fe949366c6c23 to your computer and use it in GitHub Desktop.
Bind local port to remote port with plain SSH (basically ngrok)
# generic version
ssh -R <remote_port>:<local_interface>:<local_port> <remote machine>
# example (dev is a host configured in ~/.ssh/config)
ssh -R 4567:localhost:4567 dev
# Ubuntu hosts require an extra step of config
# http://askubuntu.com/questions/50064/reverse-port-tunnelling/50075#50075
# (run on server)
sudo echo -e "Match User scott\n GatewayPorts yes" >> /etc/ssh/sshd_config
service ssh restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment