Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

When you need to create reverse SSH tunnel from your system/node.

**This is a security risk if the tunnel is left open; please advise with your IT/SysAdmin prior to opening up reverse SSH tunnel for ANYONE. Exxact Corp is not responsible for any security-related issues/events if using the below article to assist in this procedure.**

Step-by-step guide

  1. SSH from the destination to the source (with public IP) using the command below:

    Code Block
    languagejava
    ssh –f –N –T –R 19999:localhost:22 sourceuser@138.47.99.99
    
    ## '19999' can be any unused port


  2. Now you can SSH from source to destination through SSH tunneling:

    Code Block
    languagejava
    ssh localhost -p 19999


  3. 3rd party servers can also access 192.168.20.55 through Destination (138.47.99.99)
    Destination (192.168.20.55) <- |NAT| <- Source (138.47.99.99) <- Bob's server 

    1. From Example's server:

      Code Block
      languagejava
      ssh sourceuser@138.47.99.99


    2. After the successful login to Source:

      Code Block
      languagejava
      ssh localhost -p 19999
      
      ## the connection between destination and source must be alive AT ALL TIMES


  4. Closing SSH tunnel:
    • Rebooting system
    • Find the process and kill the PID
    • Remove all SSH sessions, all of them...

      Code Block
      languagejava
      sudo killall ssh


...