Configuration of SSH remote port forwarding in Linux

Source: Internet
Author: User
Tags ssh

When I was developing the telegram bot, I wrote the code locally and uploaded it to the server for testing. Because Telegram's Setwebhook URL is on the line. This is the same as the Access server configuration for the development of micro-credit public numbers.

Of course, this is not much of a development efficiency.

There are some tools for port mapping on the web, such as Ngrok, but SSH itself takes such a tool.

Assuming I telegram Webhook address is Https://www.111cn.net/telegram, the server is running on port 3344, and the local development environment is running on the localhost:3344 address, run the following command:

Ssh-r 3344:localhost:3344 admin@zfanw.com

You can then complete the remote port forwarding to the local. In this way, the data telegram to the Https://www.zfanw.com/telegram address POST will be forwarded to my local localhost:3344.

Wait, how do you break the forwarding? First, the SSH connection is not stable and can easily be broken off. If you are lucky, enter

Exit

Enter to exit.

Of course, we can also press CTRL-C to force the exit.

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.