SSH port forwarding realizes the realization of intranet penetration

SSH port forwarding, also known as SSH tunneling, is a technology for forwarding local TCP ports to remote servers, and is usually used for intranet penetration.

Here are some steps:

1. Open a terminal on Windows or other local operating systems.
2. Connect to the remote server: ssh user@remote-server-ip.
3. Enable port forwarding and specify the local port to be forwarded and the target port of the remote host: ssh -L local-port:remote-host:remote-port user@remote-server-ip.
4. In this way, the traffic of the local port local-port will be forwarded to remote-host:remote-port on the remote server through the SSH tunnel. Set the port in the application to use the local to access the remote host.

For example, to forward local port 80 to port 80 of remote server 192.168.1.100:

ssh -L 80:192.168.1.100:80 user@remote-server-ip

You can then enter localhost:80 in your browser to access the web application on the remote server.

It should be noted that the way of SSH tunnel is to forward all the traffic to the remote host. If multiple people use this tunnel at the same time, the performance of the tunnel will be affected. At the same time, the SSH tunnel will bring certain performance overhead in data encryption and other aspects.

Guess you like

Origin blog.csdn.net/m0_57790713/article/details/130758653