xidica

Well-Known Member
Apr 21, 2005
63
0
156
Texas
disabling portsentry for certain ports

Just FYI, I had an issue with portsentry preventing access to the secure ports while the non-secure were running and stunnel was also running :

[email protected] [/etc/portsentry]# netstat -l --program | grep stunnel
tcp 0 0 *:imaps *:* LISTEN 29792/stunnel-4.04l
tcp 0 0 *:2083 *:* LISTEN 29792/stunnel-4.04l
tcp 0 0 *:pop3s *:* LISTEN 29792/stunnel-4.04l
tcp 0 0 *:2087 *:* LISTEN 29792/stunnel-4.04l
tcp 0 0 *:2096 *:* LISTEN 29792/stunnel-4.04l

Simple cpanel restart didn't fix it.

After :
/etc/rc.d/init.d/portsentry stop
/etc/rc.d/init.d/cpanel restart
/etc/rc.d/init.d/portsentry start

Everything is working.

The permanent fix for this is to add the ports to the exclude list so that portsentry will ignore these ports and never bind to them.

in /etc/portsentry/portsentry.conf change :
ADVANCED_EXCLUDE_TCP="113,139" <- default setting from my experience
to :
ADVANCED_EXCLUDE_TCP="113,139,2083,2087,2096"

restart portsentry :
/etc/rc.d/init.d/portsentry restart

Hope this helps someone, and I have no idea why these ports aren't excluded by default. My guess is that portsentry doesn't mess with the non-secure as they don't contain as much gibberish(at least as far as the tcp wrapper is concerned)
 

phpcoder1

Member
Sep 26, 2004
12
0
151
I'm having trouble with this, and this is still outputting this whenever I try to restart portsentry/cpanel...

Starting cPanel SSL services: [ FAILED ]

And nothing anybody said would work...
 

xidica

Well-Known Member
Apr 21, 2005
63
0
156
Texas
phpcoder1 said:
I'm having trouble with this, and this is still outputting this whenever I try to restart portsentry/cpanel...

Starting cPanel SSL services: [ FAILED ]

And nothing anybody said would work...
Are there any errors in the log? Have you checked to see what is in the file /usr/local/cpanel/etc/stunnel/default/stunnel.conf ?
Is it looking for cpanel.pem or mycpanel.pem ? If so does the file exist? i've seen a few issues where it's looking for one, but the other is correct. I've usually just made a symlink so if it looks for either it will find it(as I'm not sure if cpanel upcp's rewrite this conf file). Any unusual error messages in the logs?
 

phpcoder1

Member
Sep 26, 2004
12
0
151
What should I do? Logs say nothing about SSL. It's looking for /usr/local/cpanel/etc/cpanel.pem. cPanel.pem has RSA/key stuff... tell me step-by-step what to do by PMing me.