How to setup SSH VM Access with Port Forwarding
With this setup you will be able to:
- Access the application UI through your web browser
- Access the VM through a terminal
These steps assume the following:
- You are using Ubuntu 22.04 or later.
- VM access will be secured via a private key stored in ~/.ssh/myKey.pem, and the connection will be to firstname.lastname@example.org. You will need to tweak these details accordingly for your specific use case.
To setup an SSH tunnel with a SOCKS proxy, follow these steps:
For Charmed Kubeflow run this command:
ssh -i ~/.ssh/myKey.pem -D 9999 email@example.com
For Charmed MLflow run this command:
ssh -i ~/.ssh/myKey.pem -L 31380:localhost:31380 -D 9999 firstname.lastname@example.org
Note: for MLflow you’ll see the additional
-L 31380:localhost:31380option. This forwards localhost port
31380to the remote machine, because we need this to access the MLflow dashboard.
On your laptop’s network settings:
Settings > Network > Network Proxy.
- Set the network proxy to ‘Manual’.
- Set the SOCKS host to:
Note: Once this is done, all your network traffic will go through the SSH tunnel to the VM. If the SSH tunnel is closed, then you’ll lose internet.
To deactivate this setup, first revert your network settings by disabling the network proxy, then close the SSH tunnel.
Last updated 3 months ago.