Skip to content

Instantly share code, notes, and snippets.

@elyezer
Created January 14, 2014 02:36
Show Gist options
  • Save elyezer/8412079 to your computer and use it in GitHub Desktop.
Save elyezer/8412079 to your computer and use it in GitHub Desktop.
How to create a reverse proxy using an EC2 instance
sudo vim /etc/ssh/sshd_config
# Set GatewayPorts option to yes
sudo service sshd restart
REMOTE_PORT=8080
LOCAL_PORT=8000
INSTANCE_HOST=instance.host.compute.amazonaws.com
KEY_PATH=~/.ssh/mykey.pem
ssh -R *:$REMOTE_PORT:localhost:$LOCAL_PORT -i $KEY_PATH ec2-user@$HOST -N
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment