centos 7 cant change ssh port - selinux policy 30 missing
I'm running centos 7.3 with LAMP After changing my ssh port in /etc/ssh/sshd_config I have run
semanage port -a -t ssh_port_t -p tcp <my port>
But its kicking out the following error
SELinux: Could not downgrade policy file /etc/selinux/targeted/policy/policy.30, searching for an older version.
SELinux: Could not open policy file <= /etc/selinux/targeted/policy/policy.30: No such file or directory
libsemanage.semanage_reload_policy: load_policy returned error code 2. (No such file or directory).
SELinux: Could not downgrade policy file /etc/selinux/targeted/policy/policy.30, searching for an older version.
SELinux: Could not open policy file <= /etc/selinux/targeted/policy/policy.30: No such file or directory
/sbin/load_policy: Can't load policy: No such file or directory
libsemanage.semanage_reload_policy: load_policy returned error code 2. (No such file or directory).
OSError: No such file or directory
Im running a cloud storage on this server and what to get rid of the default port 22 before I start throwing work on it :(
any ideas ?
Ok on further investigation it would seem that the reason I am having this issue is because my particular build of centos 7 is maintained by scaleway, my vps company. Frustratingly they don't support SElinux so it's disabled in boot somehow.
There is some mention of the issue on the scaleway github for the centos image. It would seem there is someway of allowing it by changing to a fedora bootscript. I fear beyond my linux abilities !
So if you find your way here and your on a vps the runs custom images - that could be your issue :/
Edit: In fact it was easy to change the boot script on scaleway -> https://www.scaleway.com/docs/bootscript-and-how-to-use-it/ SElinux now up and running :)