To perform the same action from the CLI, execute the ssh command in the following manner on the client computer:. The above command tells the ssh program to listen on TCP port on the client computer and forward it to TCP port 80 on server02 The SSH tunnel is now established. You should be able to get a response from the HTTP server running on server This type of port forwarding will not work for FTP sessions. UDP port forwarding is a bit more complicated. The packet is then tunneled via the SSH connection.
The reply flows back in a similar fashion. The above command will instruct ssh program to listen on TCP port on the client computer and forward it to TCP port on server01 local interface As the communication is encrypted, all the firewalls I know, allow any encrypted connection to remote ports like it would be a HTTPS connections but in this case, is our SSH server ;.
I know, it is not easy, usefull only in specific cases and you need a lot of things to make it work, but it is funny!!! Your email address will not be published. Save my name, email, and website in this browser for the next time I comment. Posted by Carlos Villabrille on September 24, I've looked into compiling it myself but can't really be bothered now. That should do it. Gaff Peter V. It seems socat keeps the existing connection open long enough to tunnel the answer back the same way the request came.
And this is the main improvement of socat over nc. Socat handles that. So with nc , SNMP forwarding will work "for a little while" only. And not at all with parallel requests. Michael Michael 63 2 2 silver badges 6 6 bronze badges. A ssh-only solution won't do it. For udp you'll need to tunnel your udp packets over one or more tcp-sockets like they do in the other answers. Aleksandr Dubinsky Aleksandr Dubinsky 2 2 gold badges 6 6 silver badges 17 17 bronze badges.
Zach Sparks Zach Sparks 9. Please see How do I write a good answer in the Help -section. I'd suggest editing the answer to include how exactly the issue was resolved. As it is it's not very helpful, and will likely be flagged for length and quality, and will likely be deleted.
This would be OK as a comment, but you will need to collect some reputation before you're allowed to comment. Peregrino69, acctually it is a useful answer.
It's very useful to know that UDP packets are not forwardable on their own. Then one can decide what approach to use. For example, I can ask my software that needs tunnel to use TCP and other answers I need to decipher to understand that.
I don't need other tools. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Podcast Making Agile work for data science. Stack Gives Back Featured on Meta. New post summary designs on greatest hits now, everywhere else eventually. Linked 0.
0コメント