Step 3: Allow new SSH port on SELinux
The default port labelled for SSH is 22.
$ semanage port -l | grep ssh
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.
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.
$ semanage port -l | grep ssh
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.
sudo firewall-cmd --add-port=2200/tcp --permanent
sudo firewall-cmd --reload
文章评论