I have been on linux long enough to think I know how things work in a Linux system, however lately I discovered I still don’t know everything there is to know.
After installing fedora 34 I followed this post installation guide. I followed the advice to change the default port number for ssh to a custom one. To make it pass trough the firewall I also had to add a new firewall rule to allow traffic trough the new port on the firewall aswell as updating the iptables. And thats where the confusion started.
I have never heard of iptables before, but a google search informed me to either use firewalld or iptables. However I discovered both are running on my fedora install, because after typing
sudo iptables -L -v in the commandline it actually gave me some output.
So my question is: Do I actually need iptables if I’ m allready using firewalld and do I need to make changes to both when changing a port number? Please tell me all there is to know about it so I can carry on with confidence. Thanks in advance.
By the way to actually allow ssh to make use of this new port you also have to run
sudo semanage port -a -t ssh_port_t -p tcp 2222 to except the changes for SElinux.