The following content is from the network and is backed up: ssh supports port forwarding. Ssh's three powerful port forwarding commands: QUOTE: ssh-C-f-N-g-Llisten_port: DST_Host: DST_portuser @ Tunnel_Hostssh-C-f-N-g-Rliste...
The following content is from the network and is saved as a backup:
Ssh supports port forwarding.
Three powerful port forwarding commands of ssh:
QUOTE:
Ssh-C-f-N-g-L listen_port: DST_Host: DST_port user @ Tunnel_Host
Ssh-C-f-N-g-R listen_port: DST_Host: DST_port user @ Tunnel_Host
Ssh-C-f-N-g-D listen_port user @ Tunnel_Host
-F Fork into background after authentication.
The user/password for background authentication, usually used with-N. you do not need to log on to the remote host.
-P port Connect to this port. Server must be on the same port.
The sshd service port of the logged-on ssd server.
-L port: host: hostport
Forward a port of the local machine (client) to the specified port of the remote specified machine. the working principle is as follows: a socket listening port is allocated on the local machine. Once a connection is established on the port, the connection is forwarded through a secure channel, at the same time, the remote host establishes a connection with the host's hostport. you can specify port forwarding in the configuration file. only the root user can forward the privileged port. description of IPv6 address in another format: port/host/hostport
-R port: host: hostport
Forward a port of the remote host (server) to the specified port of the local host. the working principle is as follows: a socket listening port is assigned to the remote host. Once a connection is established on the port, the connection goes through the secure channel, establish a connection between the local host and the host's hostport. you can specify port forwarding in the configuration file. only the root user can log on to the remote host to forward the privileged port. description of IPv6 address in another format: port/host/hostport
-D port
Specifies a local machine "dynamic'' application port forwarding. the working principle is as follows: a socket listening port is allocated on the local machine. Once a connection is established on the port, the connection is forwarded through a secure channel, based on the application protocol, you can determine where the remote host will be connected. currently, the SOCKS4 protocol is supported and will act as the SOCKS4 server. only the root user can forward the privileged port. you can specify dynamic port forwarding in the configuration file.
-C Enable compression.
Compressed data transmission.
-N Do not execute a shell or command.
Do not execute scripts or commands, usually used with-f.
-G Allow remote hosts to connect to forwarded ports.
In the-L/-R/-D parameter, the remote host is allowed to connect to the forwarding port established. If this parameter is not added, only the local host is allowed to establish a connection.
Author "Loven"