I have two servers "Intranet" and "Internet" both running Linux.
A site is hosted on Intranet on port 8080. I would like to tunnel traffic from Intranet:8080 to the Internet:8008 server so that when someone attaches to Internet:8080 they access the web server on Intranet:8080
I cannot establish an SSH connection from Internet->Intranet as we are behind a firewall. But I could create a reverse tunnel from Intranet->Internet.
Is there a way to accomplish this with an SSH tunnel?
Related
I'm developing some webhook required direct access public domain to internal machine, thinking use SSH tunnel to forward data, or got alternative solution?
Hosting server & development machine are in same network
192.168.1.2/24 (Hosting server)
2nd machine is virtual mapping using forticlient firewall without static or dynamic IP in visible in hosting server, so is 1 way initial communication right now.
In this case possible to setup SSH tunnel forward all traffic from 192.168.1.2:80 to handle in development machine port 8080?
How to ssh syntax look like?
Thanks.
This could be done by setting up an SSH tunnel to the remote machine:
ssh -L localhost:80:localhost:8080 development-system
Every request to port 80 on the hosting-server is now forwarded to port 8080 on the development-system.
Please note, that the port 80 on the hosting-server could only be used, when you start the SSH command as root. Also note that the port 80 is only accessible from the hosting-server. To access the port 80 on the hosting-server from everywhere use the following:
ssh -L 80:localhost:8080 development-system
Be sure that you want that.
A good introduction to the topic could be found at
https://www.ssh.com/ssh/tunneling/example
https://unix.stackexchange.com/questions/115897/whats-ssh-port-forwarding-and-whats-the-difference-between-ssh-local-and-remot
I am trying to access a linux server through ssh. Typically this is accessed through a Win2012 jump server using putty.
I was able to setup a reverse ssh connection in putty from jump server to a AWS VM through HTTP proxy. And this was supposed to forward it to my linux server. But when I connect to my AWS VM and initiate ssh over my remote port, the whole thing just hangs. What am I doing wrong, and is there a better/easier way? No malicious intent, I have physical access to both jump server and linux server. Just bypassing shitty corp firewall.
Can you explain what you did in details ?
Typically on unix systems, for a reverse ssh tunnel, you can do this on your server behind the firewall:
ssh -NR ssh_port_AWS:localhost:ssh_port_local_server user#ip_AWS
You need to replace
ssh_port_AWS by the port of the distant server that you want to use to access the local server.
ssh_port_local_server by the port of the ssh server of your local server (if you don't change anything, 22).
user#ip_AWS by your AWS connection details (user#IP)
I want to connect to a remote server (host1) that accessible only from it's private network.
Another server (host2) is accessible from the Internet.
I opened a tunnel to host2 using PuTTY and tested it's working with Firefox (also checked that I got different IP address).
How can I connect to host1 using the tunnel I created?
I tried to configure proxy (to the tunnel I created - localhost) in PuTTY but it's not working.
The error I got: "Server unexpectedly closed network connection"
Pay attention that the host is the computer name in the network.
You connect to the local tunnel end directly, no "proxy" setting is needed.
This typically means that you use "localhost" as a Host Name. And a port according to your tunnel configuration.
See my guide for tunneling SFTP/SCP session. It's for WinSCP, but just use PuTTY instead of WinSCP in section Connecting through the tunnel.
How can I configure squid server on my local machine to redirect traffic to SSH tunnel created with Putty?
That's my goal:
webBrowser--->Squid--->SSHTunnel--->remoteServer--->anything
I'm developing a PHP application on my localhost (Windows) using Xampp. I need to access a third party API from my application but I only have access to the API using our online server IP address.
How can I re-route my Apache requests to internet thru our online server using SSH tunnel?
(I can't setup a VPN connection)
Thanks
Assuming your the URL for your third party API is at:
192.168.200.100 on port 80
And your online server IP is:
10.10.10.100
To open the tunnel run the following command:
ssh -L127.0.0.1:8888:192.168.200.100:80 10.10.10.100
The ssh command will manually connect you to your online server and open an SSH tunnel that you can reference at:
127.0.0.1 on port 8888
So in your PHP application instead of connecting directly to the third party server at 192.168.200.100, you use your local IP and port (127.0.0.1:8888) instead.