Enforce policy:
Edit selinux configuration:
1 |
vim /etc/sysconfig/selinux |
Make sure the following settings are:
1 2 |
SELINUX=enforcing SELINUXTYPE=targeted |
Install semanage tool:
Find a package that contains semanage:
1 |
yum provides */sbin/semanage |
For example:
1 |
yum install policycoreutils-python |
will install semanage
Change default SSH Port to 777:
Run semanage tool:
1 |
semanage port -a -t ssh_port_t -p tcp 777 |
Configure sshd to use port 777 and restart ssh deamon:
1 |
/etc/init.d/sshd restart |
If SELinux is not configured, secure log will display error: Bind to port 777 onĀ 0.0.0.0 failed: Permission denied.