Hosting a local server SSH tunnel via vps

Here you can discuss every aspect of Debian. Note: not for support requests!

Hosting a local server SSH tunnel via vps

Postby devind0 » 2018-11-30 04:20

Hello. Bit of an odd scenario here. I have a business where I am co locating a server that I would like to set up as a web server. I am unable to host the web server directly off the business ip address, and would prefer not to expose the public ip of the shop to the world. I have a vps running debian, I was curious if i could set up some kind of configuration that would allow me to set up a ssh tunnel of sorts to send all traffic destined for the VPS to the shop via a ssh tunnel.

I figured this scenario would be ideal as all i would need to do is keep a ssh port open and I could keep everything else blocked behind a firewall.

Any infortation to help get it set up of better understand how to configure things to work in this manner would be appreciated.
devind0
 
Posts: 6
Joined: 2012-10-11 23:34

Re: Hosting a local server SSH tunnel via vps

Postby dilberts_left_nut » 2018-11-30 04:53

Why not just run the website on your VPS?
AdrianTM wrote:There's no hacker in my grandma...
User avatar
dilberts_left_nut
 
Posts: 4913
Joined: 2009-10-05 07:54
Location: enzed

Re: Hosting a local server SSH tunnel via vps

Postby reinob » 2018-11-30 09:16

devind0 wrote:Hello. Bit of an odd scenario here. I have a business where I am co locating a server that I would like to set up as a web server. I am unable to host the web server directly off the business ip address, and would prefer not to expose the public ip of the shop to the world. I have a vps running debian, I was curious if i could set up some kind of configuration that would allow me to set up a ssh tunnel of sorts to send all traffic destined for the VPS to the shop via a ssh tunnel.

I figured this scenario would be ideal as all i would need to do is keep a ssh port open and I could keep everything else blocked behind a firewall.

Any infortation to help get it set up of better understand how to configure things to work in this manner would be appreciated.


You want to use remote port forwarding (ssh -R). There are many examples you can find by searching (the manpage may be a bit dry but should always be your first hop).

Code: Select all
ssh -R 443:localhost:443 root@your.vps.ip


should forward port 443 of your vps to port 443 of your localhost (i.e. where you host your web site and run the above command).
reinob
 
Posts: 573
Joined: 2014-06-30 11:42

Re: Hosting a local server SSH tunnel via vps

Postby pcalvert » 2018-11-30 14:58

devind0 wrote: am unable to host the web server directly off the business ip address, and would prefer not to expose the public ip of the shop to the world.

Cloudflare may be able to help you with that.

Phil
“Property is the fruit of labor; property is desirable; it is a positive good
in the world. That some should be rich shows that others may become
rich, and hence is just encouragement to industry and enterprise.”
— Abraham Lincoln
pcalvert
 
Posts: 1808
Joined: 2006-04-21 11:19
Location: Sol Sector


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 3 guests

fashionable