SELinux allow non default SSH port

By default, SELinux only allows running SSH service on default port 22. For security, it is better to change the SSH port to a non-standard port. On Systems running SELinux, sshd service will fail to start if you change the SSH port.

To allow a custom SSH port, run

semanage port -a -t ssh_port_t -p tcp SSH_PORT_HERE

For example, to alow sshd service run on port 3333, use

semanage port -a -t ssh_port_t -p tcp 3333

Back to SELinux

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *