Welcome, Guest. Please login or register.
Did you miss your activation email?
+  pfSense Forum
|-+  pfSense English Support» NAT» SSHD and Https both on Port 443
Username:
Password:
 
 

Pages: [1]   Go Down
  Print  
Author Topic: SSHD and Https both on Port 443  (Read 936 times)
0 Members and 1 Guest are viewing this topic.
yumbaman
Newbie
*
Offline Offline

Posts: 6


View Profile
« on: June 29, 2009, 11:10:55 am »

I would like to setup my firewall/nat on my network to allow incoming connections on port 443 to sshd and https.  I am running sshd on pfsense xxx.xxx.xxx.65 and my CentOS 5 server is running HTTPS apache on xxx.xxx.xxx.69.  Can IPtables detect the different protocols and redirect the request?  Do I have to use subdomains and apache mod_proxy?  I have seen something like sslh, but I don't think in runs on PFsense.  I would prefer pfsense to handle the requests, but if required I will install a proxy like squid or whatever.  Thanks.
Logged
Bern
Full Member
***
Offline Offline

Posts: 135


View Profile
« Reply #1 on: June 29, 2009, 01:57:31 pm »

Since they're on different IP addresses, you should be able to NAT the HTTPS to your CentOS box and let pfSense handle the SSH.
Logged
ktims
Sr. Member
****
Offline Offline

Posts: 296



View Profile
« Reply #2 on: June 29, 2009, 02:29:49 pm »

You can't run HTTPS and SSH on the same IP/port, it will never work. Choose different ports for each service or get a second IP.
Logged
yumbaman
Newbie
*
Offline Offline

Posts: 6


View Profile
« Reply #3 on: June 29, 2009, 04:39:31 pm »

Why can't I use the information in the packet with like a sniffer or grab a connect or user agent out of the packets?  It seems like a proxy solution or a semi-simple script written in C.
Logged
yumbaman
Newbie
*
Offline Offline

Posts: 6


View Profile
« Reply #4 on: June 29, 2009, 04:41:28 pm »

http://www.rutschle.net/tech/sslh.shtml
Someone has already done this.  But it is written for the linux kernel instead of the Unix kernel.  Can we port this to pfsense/FreeBSD?
Logged
jahonix
Hero Member
*****
Offline Offline

Posts: 792



View Profile
« Reply #5 on: June 29, 2009, 06:30:20 pm »

I am running sshd on pfsense xxx.xxx.xxx.65 and my
CentOS 5 server is running HTTPS apache on xxx.xxx.xxx.69.

You already have separate IPs. Assumingly public IPs. Why would you want to do that?
Logged

Chris


Theoretically, theory and practis should be the same.
Practically they aren't.
ktims
Sr. Member
****
Offline Offline

Posts: 296



View Profile
« Reply #6 on: June 29, 2009, 07:26:22 pm »

Interesting hack. From a quick glance, it doesn't look like this uses any Linux-specific system calls, so it will likely build on FreeBSD, or at least should be easy to port. You could try compiling it on a FreeBSD 7.1 installation and if it builds, the binary should run on pfSense. That's a start, then you can work on getting a package created for better integration if you like.
Logged
yumbaman
Newbie
*
Offline Offline

Posts: 6


View Profile
« Reply #7 on: June 30, 2009, 09:10:52 am »

I only have one dynamic IP address.  The other listed IPs are internal.
Logged
yumbaman
Newbie
*
Offline Offline

Posts: 6


View Profile
« Reply #8 on: June 30, 2009, 09:12:13 am »

Can apache or squid read packets and forward them to the correct destination when rules are set? 
Logged
Bern
Full Member
***
Offline Offline

Posts: 135


View Profile
« Reply #9 on: June 30, 2009, 03:20:16 pm »

Quote
I only have one dynamic IP address.  The other listed IPs are internal

Right, that makes all the difference! You didn't say that in the original post, nor in two of your follow-ups and it's details like that which make a difference.

Are there any other seemingly-minor details we need to know about? Since the sslh daemon will introduce an up-to-two-seconds delay, can you tolerate that?

What restrictions are being put on you that forces you to use 443 for both services? Are you trying to bypass a workplace policy of some kind?

Are the HTTPS and SSH servers for your own use or for general public use?

Can you use 465 (SMTPS) or 993 (IMAPS) for SSH, for example?

If it's largely for your own use, use SSH tunnels, stunnel or OpenVPN and multiplex the connections over a single secure channel.

Details!
Logged
yumbaman
Newbie
*
Offline Offline

Posts: 6


View Profile
« Reply #10 on: June 30, 2009, 03:28:55 pm »

I need HTTPS for apache on my Centos box for my websites.  At work and at my college we are restricted to 80 and 443.  I have HTTPS set to port 8080, but then I have to rewrite each web service where to forward https requests.  I have not yet done this, instead just tell users to type it in their web browser.  https://taco.mexico.com:8080/ as an example.  But I need 443 for ssh to punch a tunnel into my network for vnc, rdp, winscp, sftp, and other services that I require.  1 or 2 second delay does not sound that bad.  It is for a home office network.  Most likely, I will have very few concurrent connections.
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

 

Page created in 0.307 seconds with 20 queries.