CentOS Linux 7.4中polkit服务启动失败

**当在CentOS Linux7系统中自动脚本安装时,出现以下报错:**

==> SSH
Authorization not available. Check if polkit service is running or see debug message for more information.
Redirecting to /bin/systemctl restart sshd.service
Authorization not available. Check if polkit service is running or see debug message for more information.
Failed to restart sshd.service: Connection timed out
See system logs and ‘systemctl status sshd.service’ for details.

  1. 1.确保polkitd系统用户和组的存在 将以下2个复合命令复制、粘贴到根终端以检查并有条件地创建用户
    [root@hdfs1.safedog.cn ~]# /dev/null && echo -e “\e[1;32mpolkitd
    group already exists\e[0m” || { groupadd -r polkitd && echo -e
    “\e[1;33mAdded missing polkitd group\e[0m” || echo -e “\e[1;31mAdding
    polkitd group FAILED\e[0m”; }

    [root@hdfs1.safedog.cn ~]# /dev/null && echo -e “\e[1;32mpolkitd user already exists\e[0m” || { useradd -r -g polkitd -d / -s
    /sbin/nologin -c “User for polkitd” polkitd && echo -e “\e[1;33mAdded
    missing polkitd user\e[0m” || echo -e “\e[1;31mAdding polkitd user
    FAILED\e[0m”; }

  2. 重置polkit和polkit-pkla-compat包提供的所有文件的权限和用户/组所有权将以下复合命令复制/粘贴到根终端,以检查并有条件地重置用户/组权限和所有权

    [root@hdfs1.safedog.cn ~]# rpm -Va polkit* && echo -e “\e[1;32mpolkit* rpm verification passed\e[0m” || { echo -e “\e[1;33mResetting polkit* rpm user/group ownership & perms\e[0m”; rpm --setugids polkit polkit-pkla-compat; rpm --setperms polkit polkit-pkla-compat; }

  3. 重新启动
    需要重新启动计算机以确保所有更改都生效并且polkit已重新连接到dbus
    [root@hdfs1.safedog.cn ~]# reboot

Logo

更多推荐