Configure port forwarding using OpenSSH in Linux

Source: Internet
Author: User
In Linux, use OpenSSH to configure port forwarding-Linux Enterprise Application-Linux server application information. The following is a detailed description. Accessing the company's CVS server from your computer requires the port forwarding function of the SSH client. Previously in Windows, SecureCRT was generally used as the SSH client. After that, I migrated my work platform to Ubuntu Linux, but I could not find a way to directly Configure port forwarding using OpenSSH. I only know how to use PuTTY Tunnel to do this, but I feel a little awkward when I open an application but only do port forwarding.
Coincidentally yesterday, I accidentally found some articles about OpenSSH port forwarding configuration. The following example shows how to configure the port forwarding function of OpenSSH. The configuration file to be modified is ~ /. Ssh/config.

Host testsrv
Hostname 123.45.67.89
User cvs_user
LocalForward 2401 123.45.67.90: 2401

The Host is followed by the Host name. After specifying this name, you can use this name to replace the Host's IP address. For example

Ssh testsrv
Equivalent
Ssh 123.45.67.89

The User is the User name used to connect to the host.

LocalForward is used to configure the port forwarding function. 2401 indicates the local port number. 123.45.67.90: 2401 is the IP address and service port of the CVS server (that is, the target host and port of the forwarding ). LocalForward indicates that the local port is used for forwarding. If you want to use a remote port for forwarding, The RemoteForward parameter is used. After the configuration is complete and the connection to the host testsrv is successful, a secure SSL encryption channel is established.
Note that in some articles

(1) 2401 123.45.67.90: 2401
Written
(2) 2401: 123.45.67.90: 2401

The format shown in (2) is the format used to directly Configure port forwarding Parameters Using ssh on the terminal. For example

Ssh-L 2401: 123.45.67.90: 2401 cvs_user@123.45.67.89

It is also equivalent to the content configured in the configuration file.
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.