LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 11-27-2006, 11:27 AM   #1
Senth
LQ Newbie
 
Registered: Nov 2006
Posts: 1

Rep: Reputation: 0
Port forwarding using subdomain


I got a "simple" problem, to help you understand it I'll first draw the problem.

School (only allowing port 80 out)
->
Router (Forwarding port 80 to server)
->
Server (Displays my home page (Apache) and has a ssh server)

Since I wan't to get access to my server while I'm at the school I need to ssh it. But that won't work since they blocked all the ports except port 80. I can't use ssh at port 80 (at least not at the server since I got a homepage).

Example:
Connecting to my ssh server from school using port 80 via sshDOTmy-domainDOTorg
Then my server checks which subdomain is used and if it's ssh it'll forward it to port 22

Is this possible?

I'm quite new to Linux, in other words a newbie.

Thanks for the help
 
Old 11-27-2006, 12:39 PM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Would a web based ssh proxy be useful?
http://sourceforge.net/projects/sshwebproxy
 
Old 11-27-2006, 01:02 PM   #3
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 76
It's not possible to forward services based on what name the client used to access it, since the packets arrive addressed by IP, not by hostname (hostnames are client-side conventions, mostly). What you need is either a second IP address, or to be able to use other port numbers. I'm betting port 443 might be available. As long as you're not trying to host any SSL-enabled sites in Apache, you could simply add another port to SSH in /etc/ssh/sshd_config. Here's a snippet:

Code:
old:
#Port 22
#Protocol 2,1
#ListenAddress 0.0.0.0
#ListenAddress ::
...

new:
Port 22
Port 443
Protocol 2
#ListenAddress 0.0.0.0
#ListenAddress ::
...
The only other option would be a TCP proxy running from Apache on a hidden page of your website. You sure wouldn't want a link to such a thing or it will be abused.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
IPCHAINS port forwarding and IPTABLES port forwarding ediestajr Linux - Networking 26 01-14-2007 07:35 PM
Simple Port Forwarding Firewall - not forwarding MadTurki Linux - Security 14 04-09-2006 12:08 PM
Port 80 forwarding to port 22 with iptables zahoo Linux - Networking 3 02-22-2005 07:22 AM
port forwarding and packet forwarding syrtsardo Linux - Newbie 2 07-03-2003 10:37 AM
forward subdomain to ip & port andjules Linux - Networking 6 12-11-2002 04:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:56 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration