CentOS

Från wiki.soltec.se
Version från den 8 januari 2019 kl. 12.30 av Js146669 (Diskussion | bidrag) (SSH tunnel on CentOS)

Hoppa till: navigering, sök

How To Create a SSH tunnel from your laptop (SRC) through multiple hosts to a target (TGT) host

Use Virtual Box for virtualisation from your windows laptop.

Step #1 Create the tunnel from your vbox VM to the TGT server On the vbox vm or cygwin host create a tunnel to the IP and port number of the TGT server that you wish to access.

  • $ ssh -L *:7777:<TGT IP>:8181 < TGT IP>
- The < - L * > allows connections from any interface.
- 7777 is the port on your localhost/VM that is configured to connect to port 8181 of the TGT host.
- Leave the connection open in it's own terminal window for your connection to work.

Step #2

  1. - Create the tunnel from your laptop to your VM
  2. - On your laptop use PuTTy to create a tunnel to your vbox/cygwin VM instance.
  3. - Load/create a connection to your VM with the following configuration
- IP: 127.0.0.1 Port: 22
  1. - Under <Connection> - < SSH > - < Tunnels > add the port on your laptop that you want to use to forward to the port you setup in the previous step on your VM
- Laptop Port: 5555 (as an example)
- VM Port: 7777 (created in step #1)
  1. -Enter the above info in the cfg box as per below.
- Source port: 5555
- Destination: IP of your VM instance e.g. 10.0.3.15:7777
  1. - Click on < Apply >

Step #3 Test your connection by opening a BUI on your laptop and entering the following in the URL http://127.0.0.1:5555

You should see the web page presented by your TGT server on a browser direct from your laptop.