我的centos7开启防火墙时出现如下错误提示:
[root@VM-0-7-centos redis]# firewall-cmd --state
not running
[root@VM-0-7-centos redis]# systemctl start firewalld.service
-bash: /usr/bin/systemctl: Permission denied
解决方法
1、首先使用chmod -R 750 /usr/bin/systemctl
命令给该命令添加权限
可能会出现如下错误:
[root@VM-0-7-centos redis]# sudo chmod -R 750 /usr/bin/systemctl
chmod: changing permissions of ‘/usr/bin/systemctl’: Operation not permitted
2、输入lsattr systemctl
列出systemctl的属性
出现a或者i属性的需要把这两个全部去除。
[root@VM-0-7-centos bin]# lsattr systemctl
----i--------e-- systemctl
执行chattr -i systemctl
之后再去开启防火墙就成功了