Skip to content

Instantly share code, notes, and snippets.

@arunjayakumar01
Created August 4, 2020 19:36
Show Gist options
  • Save arunjayakumar01/f3704e682aac2cf453371648ac9b8431 to your computer and use it in GitHub Desktop.
Save arunjayakumar01/f3704e682aac2cf453371648ac9b8431 to your computer and use it in GitHub Desktop.

Create ssh tunnel

  • TO create a ssh tunnel use

     ssh -i <path-to-key-file> user@host -L <local PC port>:<ip address accessed from ssh PC>:<ssh pc PORT>
    

    Example :

	 ssh -i my-private-key.pem user@1.2.3.4 -L 3002:127.0.0.1:3001

  • This will make the PORT 3001 in server ith IP address 1.2.3.4 accessible as 3002 in local .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment