SELinux Policy Management Tool
Table of Contents
1. List default allowed ports for OpenSSH
semanage port -l | grep ssh
2. Allow OpenSSH to listen on tcp port 13842
semanage port -a -t ssh_port_t -p tcp 13842
3. Remove port 13842 from allowed OpenSSH ports
semanage port -d -t ssh_port_t -p tcp 13842
4. References
- https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/9/html-single/using_selinux/index#customizing-the-selinux-policy-for-the-apache-http-server-in-a-non-standard-configuration_configuring-selinux-for-applications-and-services-with-non-standard-configurations
- https://computingforgeeks.com/change-ssh-port-centos-rhel-fedora-with-selinux/