Hosting a local server SSH tunnel via vps

Here you can discuss every aspect of Debian. Note: not for support requests!
Post Reply
Message
Author
devind0
Posts: 8
Joined: 2012-10-11 23:34

Hosting a local server SSH tunnel via vps

#1 Post by devind0 »

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.

User avatar
dilberts_left_nut
Posts: 5129
Joined: 2009-10-05 07:54
Location: enzed
Has thanked: 1 time
Been thanked: 1 time

Re: Hosting a local server SSH tunnel via vps

#2 Post by dilberts_left_nut »

Why not just run the website on your VPS?
AdrianTM wrote:There's no hacker in my grandma...

reinob
Posts: 935
Joined: 2014-06-30 11:42

Re: Hosting a local server SSH tunnel via vps

#3 Post by reinob »

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).

pcalvert
Posts: 1924
Joined: 2006-04-21 11:19
Location: Sol Sector

Re: Hosting a local server SSH tunnel via vps

#4 Post by pcalvert »

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
“It is better to believe than to disbelieve; in doing so, it brings
everything into the realm of possibility.” — Albert Einstein

Post Reply