centos 7无法更改ssh端口 – selinux策略30失踪

我正在用LAMP运行centos 7.3在/ etc / ssh / sshd_config中更改我的ssh端口后,我已经运行

semanage port -a -t ssh_port_t -p tcp <my port> 

但它踢出了以下错误

 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 

我在这个服务器上运行云存储和什么摆脱默认端口22之前,我开始扔它的工作:(

有任何想法吗 ?

好吧,进一步的调查,似乎是我有这个问题的原因是因为我特定版本的centos 7是由scaleway,我的vps公司维护。 令人沮丧的是,他们不支持SElinux,因此它在启动时被禁用了。

对于centos映像,在scaleway github上提到了这个问题。 它似乎有一些允许通过更改为Fedora靴子。 我害怕超越我的Linux能力!

所以,如果你在这里find自己的方式,并在你的VPS上运行自定义图像 – 这可能是你的问题:/

编辑:事实上,它很容易改变启动脚本在缩放 – > https://www.scaleway.com/docs/bootscript-and-how-to-use-it/ SElinux现在起来,运行:)