![]() ![]() What if the Source is also behind a NAT and wants to access the Destination behind another NAT ? Otherwise, it is not possible to establish a Reverse SSH Tunnel from the Destination to the Source. The only problem with this approach to access the Destination behind a NAT router is that the Source needs to have a public IP address. ![]() $ ssh -fNT -R 20022:localhost:3000 įrom the Source, access the nodejs web application running in the Destination behind a NAT router, as follows: $ curl Problem: We can use the Reverse SSH Tunnel port forwarding feature to access the web application. Res.writeHead(200, ).listen(3000) //the server object listens on port 3000 Let’s use the following simple nodejs web application for the demo. Note: You could use the same procecure discussed below to create a reverse SSH proxy tunnel to remote access any TCP service (SSH, SMTP, MQTT, VNC etc) running in your local network or local server. Let’s say the web application listens on TCP port 3000. Let’s say you want to access a nodejs web application running in the Destination behind a NAT router. $ ssh -p 20022 How to create a Reverse SSH tunnel port forwarding ? Now you can SSH into the Destination behind NAT from the public Source via the Reverse SSH Tunnel endpoint ( port 20022) created in step 1. This is called SSH reverse proxy tunneling. For this you need to create an SSH tunnel from the SSH client to the SSH server, so that the client and its network can be accessed via the tunnel. Sometimes, you may want to access a SSH Client behind a NAT router, from a public SSH server. Normally, an SSH client would connect to an SSH server for SSH access.īut if you want SSH access to the SSH client from the SSH server? That’s when you setup a SSH reverse proxy tunnel.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |