Linux port forwarding

Source: Internet
Author: User
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"
 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.