I wannt to change the ssh default port from 22 to something else because of 2 reasons:
1. for security reasons
2. because I'm using Cloudflare and it blocks port 22 anyway
I know there are some old posts/tutorials of doing this, and I even did it about 2 years ago using CSF.
The problem is that I saw that on my WHM CSF or APF (not maintained any more?) is not installed by default and since I need only to change my ssh port, I don't think it's the only way.
I have followed this cPanel official docs: How to Secure SSH | cPanel & WHM Documentation
I made the first step of updating the `/etc/ssh/sshd_config` file to the port i want, restarted the ssh service but in documentation it also says that the Firewall needs to be updated as well to allow traffic on the new ssh port.
In the second documentation page (How to Configure Your Firewall for cPanel & WHM Services | cPanel & WHM Documentation) I can see there are 3 ways of doing this? APF, CSF and iptables. If I understood correctly, the only buildin method is the `iptables` way, but there are only examples of blocking ip, but nothing for what I want.
Can anyone recommand the easiest/secure way ?
Thanks
1. for security reasons
2. because I'm using Cloudflare and it blocks port 22 anyway
I know there are some old posts/tutorials of doing this, and I even did it about 2 years ago using CSF.
The problem is that I saw that on my WHM CSF or APF (not maintained any more?) is not installed by default and since I need only to change my ssh port, I don't think it's the only way.
I have followed this cPanel official docs: How to Secure SSH | cPanel & WHM Documentation
I made the first step of updating the `/etc/ssh/sshd_config` file to the port i want, restarted the ssh service but in documentation it also says that the Firewall needs to be updated as well to allow traffic on the new ssh port.
In the second documentation page (How to Configure Your Firewall for cPanel & WHM Services | cPanel & WHM Documentation) I can see there are 3 ways of doing this? APF, CSF and iptables. If I understood correctly, the only buildin method is the `iptables` way, but there are only examples of blocking ip, but nothing for what I want.
Can anyone recommand the easiest/secure way ?
Thanks
Last edited by a moderator: