Skip to content

Instantly share code, notes, and snippets.

@netzfisch
Created April 20, 2018 12:18
Show Gist options
  • Save netzfisch/3052cd41bd595700f1c37a5172e18dd3 to your computer and use it in GitHub Desktop.
Save netzfisch/3052cd41bd595700f1c37a5172e18dd3 to your computer and use it in GitHub Desktop.

Connect to linux box behind NAT

destination (10.0.0.3) <- |NAT| <- source (192.168.1.105)

  1. SSH from the destination to the source (with public ip)

    ssh -f -N -R 19999:localhost:22 sourceuser@192.168.1.105

  2. SSH from source to destination through above tunel

    ssh localhost -p 19999

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment