Step 3: Allow new SSH port on SELinux
The default port labelled for SSH is 22.
1 | semanage port -l | grep ssh |
输出:
1 | ssh_port_t tcp 22 |
If you want to allow sshd to bind to network port configured, then you need to modify the port type to ssh_port_t.
1 | sudo semanage port -a -t ssh_port_t -p tcp 2200 |
Confirm that the new port has been added to list of allowed ports for ssh:
1 | semanage port -l | grep ssh |
输出:
1 | ssh_port_t tcp 2200, 22 |
Step 4: Open SSH port on Firewalld
It is always recommended to keep the Firewall service running and only allow trusted services.
1 | sudo firewall-cmd --add-port=2200/tcp --permanent |
