Port Forwarding

Overview

Port forwarding, or “tunneling,” is a method of moving insecure internet traffic though a secure shell (ssh) between computers. On LinGA this is sometimes done to access web interfaces for applications and hardware on the clusters.

Sections

    Connecting
    Usage

    Example

    Related

    Port Forwarding for Windows computers


    Connecting

    On Linux and Apple computers, port forwarding is done with SSH using an extra flag (“-L”) and options specifying port and target information. The most basic port forwarding, forwards a single port from a remote machine to your local machine. Very generally, this is done using ssh and the -L flag as follows:


    ssh {username}@{remote_computer} -L {local_port}:{local_computer}:{remote_port} 

     

    Insert purpose specific settings where {} are noted or see an example here.


    Usage

    Once a port is forwarded from a remote host to your computer, you can access the port asĀ  your own. Typically this means navigating to localhost:{local_port} in a web browser and using a web application assigned to that port.

     


    Example: RStudio

    RStudio is installed on the RubySky Login Node. This particular application uses a web-interface on port 8787. Due to cluster-wide security requirements, our clusters are not directly connected to the internet and this port is inaccessible. To access this web-interface, you must securely ‘tunnel’ the traffic from the RubySky to your machine.

     


    ssh {username}@rubysky.bumc.bu.edu -L 8787:localhost:8787

     

    In this example port 8787 is forwarded from Rubysky to localhost:8787. Localhost refers to your local machine. Once connected, you can point your web browser at “localhost:8787″.

     

    r_studio