Now you have a website running on a remote linux server locally,
e.g, tensorboard --logdir=/tmp --port=8989
, and you want to
visit http://localhost:8989 on your local machine.
However, the server do not have Firefox installed so you can not use X forwarding, and your username are not in sudoers file on the server so you cannot install any software without the help from sudoer.
Use SSH to forward/tunnel a single port
Step 1: On your local machine, open terminal, run your website on remote server after SSH login, e.g., tensorboard --logdir=/tmp --port=8989
.
Step 2: On your local machine, open terminal, enable localhost tunneling: ssh -L 8989:localhost:8989 <your-username>@<ip-address-or-domain-name>
. You need to replace <your-username>
and <ip-address-or-domain-name>
with appropriate username and domain name.
Step 3: After step 1 and step 2, you should have two SSH sessions active. Do not close them, head to your Chrome or any other browser on your local machine, access http://localhost:8989. Done.