If you want to connect to a local workstation behind a firewall you can do that by bouncing traffic off of an AWS instance.
An example would be accessing a Jupyter Lab from the outside world to a machine with no static IP or behind a firewall.
The steps are:
- Create a paid AWS Ubuntu instance and save the '.pem' file.
- Make sure the AWS instance's
Security Rules
allows traffic in. - Test that you can connect to this instance from the outside world (e.g.
python3 -m http.server
orjupyter lab --ip=*
) then visit the instance using its public IP. - Enable
GatewayPorts yes
as mentioned here and restartsshd
as mentioned. - On the local workstation (e.g. GPU workstation) run the following command:
ssh -i "YOUR_PEM_FILE.pem" -R AWS_PUBLIC_IP:2222:localhost:8888 ubuntu@AWS_PUBLIC_IP