已解决:Unable to register authentication agent: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed:
生活随笔
收集整理的這篇文章主要介紹了
已解决:Unable to register authentication agent: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed:
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
1、問題描述
在部署k8s時(shí),有個(gè)步驟需要設(shè)置centos機(jī)器的時(shí)區(qū),命令如下:
timedatectl set-timezone Asia/Shanghai timedatectl set-local-rtc 0 systemctl restart rsyslog systemctl restart crond在執(zhí)行timedatectl set-timezone Asia/Shanghai時(shí)報(bào)如下錯(cuò)誤:
Unable to register authentication agent: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: Cannot determine user of subject Error registering authentication agent: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: Cannot determine user of subject (polkit-error-quark, 0)2、問題分析
這個(gè)報(bào)錯(cuò)是因?yàn)樾掳姹镜腸entos 7引起的,需要把安全進(jìn)程去掉。
3、解決方法
網(wǎng)上很多說給/跟目錄賦予755權(quán)限chmod? 755? / ,我試了不管用,使用下面方法成功:
第一步:執(zhí)行如下命令
getent group polkitd >/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"; }getent passwd polkitd >/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";第二步:執(zhí)行如下命令
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; }注意:執(zhí)行完第二步會(huì)自動(dòng)重啟。
4、結(jié)果展示
總結(jié)
以上是生活随笔為你收集整理的已解决:Unable to register authentication agent: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed:的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 已解决:sysctl: cannot s
- 下一篇: 已解决:centos 7.x系统自带的3