Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

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
Administrator
Administrator
Posts: 5346
Joined: 2009-10-05 07:54
Location: enzed
Has thanked: 13 times
Been thanked: 66 times

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: 1195
Joined: 2014-06-30 11:42
Has thanked: 99 times
Been thanked: 47 times

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: 1939
Joined: 2006-04-21 11:19
Location: Sol Sector
Has thanked: 1 time
Been thanked: 2 times

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
Freespoke is a new search engine that respects user privacy and does not engage in censorship.

Post Reply