Avatar of phper
phper asked on

WHM cPanel iptables

After WHM/cPanel was first installed by cPanel tech support I could not access WHM. I contacted cPanel and they said that my iptables need to be updated to allow access. This is what they told me to run via SSH:

iptables -L
service iptables save
service iptables stop

I don't know what that does but it makes it work. Recently, the server was reset and the iptables went back to the original settings before I changed it. I asked my hoster what happened and they said I needed to update the iptables again and save the config so if the server is reset again the correct. But they also told me that the way I opened the iptables were too liberal and the server could be prone to attacks.

My question is how should set the iptables for a normal web server that uses WHM/cPanel, FTP, SSL, MySQL, IMAP, SMTP, SSH and how do I save the configuration so when the server is reset the new config remains?
Apache Web ServerLinux SecurityWeb Development

Avatar of undefined
Last Comment
Julian Matz

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Julian Matz

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
ASKER
phper

There must be a free option. I'm just looking for a couple of lines of code.
SOLUTION
shaunak

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Julian Matz

Yes, ConfigServer Security & Firewall for cPanel is definitely 100% free. I use it myself on several servers. As far as I remember, it's very easy to install also.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy