Close port 22

Status
Not open for further replies.

telforce

Customer
Basic Certified
Joined
Feb 7, 2019
Messages
40
Reaction score
2
We install all 3CX systems with the Debian ISO on our own servers. By default port 22 is open for SSH. We would like to use another port for this. I know we can edit /etc/ssh/sshd_config for this.

But how do i change the iptables configuration? I noticed there is a brute force protection so somewhere this ISO has a firewall script in place to configure rules. I tried to enable ufw firewall but could not enable it. I also modified the iptables rules manually by closing port 22 and only opening the port for specific IP's but after a while the default rules were back again.

What is the proper way to modify the firewall rules so they stick? I suspect the /app/system_status/firewall_checker also does something to modify the rules.
 
Hi @telforce,

To confirm, are you using Debian 9 or Debian 10? By iptables I'm assuming you're using Deb 9 but just want to be sure.
 
Hi again @telforce,

You'll need to edit /etc/nftables.conf and specifically enter in your port you've configured for SSH previously, then reboot and you should be good to go. Example below:

image (1).png
 
Thanks! And do you know how to apply the changes in nftables without rebooting the server?

I tried nft -f /etc/nftables.conf but that doesn't work.
 
Hi @telforce,

No, I'm afraid that it's best to reboot the server.
 
Status
Not open for further replies.

Forum statistics

Threads
111,974
Messages
590,083
Members
164,901
Latest member
Silent_Guru