securesocketfunneling / ssf

Secure Socket Funneling - Network tool and toolkit - TCP and UDP port forwarding, SOCKS proxy, remote shell, standalone and cross platform

Home Page:https://securesocketfunneling.github.io/ssf/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Providing access to Web Page from Local PC(192.168.XX.XX) behind NAT using Public Server IP

gurtajs4 opened this issue · comments

Hi,

I am trying to figure out my ways to make below possible.

  1. I have a ubuntu Home PC serving Webpages at 192.168.XXX.XXX:80. This PC is not accessible from outside Internet because of NAT.
  2. I have a Public Server, with Public IP 34.217.XXX.XXX, which is completely accessible and I can open any ports if required.

I want to use combination of 34.217.XXX.XXX:Port to access pages from Webserver 192.168.XXX.XXX:80.
So in short if a user types 34.217.XXX.XXX:Port in browser, he should be feeded pages from my Home PC.

Can you please help me with command-line for ssfd and ssf .

Regards,
Gurtaj

commented

Hey Gurtaj,
This Issue is beyond the Scope of Github Issues, as Github Issues is supposed to identify problems with the code. However, It looks similar to what I did using my UDP ports so I'm glad to help. In the future, I'd recommend checking out stackoverflow.com.

If you're trying to have other applications access your web server, you don't even need to use SSF, as Ubuntu's built in SSH is capable of doing the TCP port forwarding just (Sacrifice is a lower effective bandwidth, so don't push hold hundreds of concurrent connections). Less DevOps is always easier.

First, modify /etc/ssh/sshd_config on your Public Server
(I think you'll need super user access)

So that you remove the # in front of
#GatewayPorts yes
and in
#AllowTcpForwarding yes

Make sure GatewayPorts and AllowTcpForwarding are both set to 'yes'.
I had to reboot my server afterwards to get it to work.

Once you've completed the server configuration, you can then do the SSH from the client (Your Home PC)

So, what I would do
[From Home PC]
ssh -N -R [Remote Port]:localhost:[local port] [user]@34.217.XXX.XXX

This will allow any connection that hits your public server IP on [remote_port] through a web browser to automatically be served by the web server listening on [local_port] of your Home PC. Browsers normally hit the default port on TCP Port 80.

The command can also be customized if you want to use different external/local ports.

Hi,

Thanks for the quick response.
I will try the above steps as described by you.

Regards
Gurtaj