10 | | ''NOTE: These instructions are NOT for Ubuntu running on Windows using Windows Subsystem for Linux (WSL).'' |
| 10 | |
| 11 | Here, we define the following arguments: |
| 12 | * localuser: your username on your local machine |
| 13 | * localmachine: the computer that you're sitting at |
| 14 | * localport: a port on your local machine, accessed via localhost:localport |
| 15 | * testbeduser: your COSMOS username |
| 16 | * remotename: the resource you wish to connect to, for example, srv1-lg1.sb1.cosmos-lab.org |
| 17 | * consolename: the dns name of the COSMOS console you're using |
| 18 | |
| 19 | The following command will allow you to access remotename:remoteport by instead accessing localmachine:localport. |
| 20 | |
| 21 | This access is tunneled through the console, consolename.cosmos-lab.org, via a ssh session running under your user account, testbeduser. |
| 22 | |
| 23 | {{{ #!shell-session |
| 24 | localuser@localmachine:~$ ssh testbeduser@consolename.cosmos-lab.org \ |
| 25 | -L localport:remotename:remoteport |
| 26 | }}} |
| 27 | |
| 28 | Here's an example, tunneling two ports to two different machines. The "-N" flag only forwards the ports, without opening a remote shell. |
| 29 | |
| 30 | {{{ #!shell-session |
| 31 | localuser@localmachine:~$ ssh testbeduser@sb1.cosmos-lab.org -N \ |
| 32 | -L 9980:srv1-lg1:80 \ |
| 33 | -L 9981:srv2-lg1:80 |
| 34 | }}} |
| 35 | |
| 36 | |
| 37 | To make permanent: |