本人环境为 Ubuntu 20.04
文章目录
- 问题描述
- 解决方案
- 解决“色彩管理设备” / "color managed device" 弹窗
- 解决“刷新系统软件源需要认证” / "refresh the system repositories" 弹窗
- 相关方法
问题描述
使用 xrdp 远程登录 Ubuntu,可能会出现以下弹框要求输入密码:
![在这里插入图片描述](https://img-blog.csdnimg.cn/20200909085744982.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3d1X3dlaWppZQ==,size_16,color_FFFFFF,t_70#pic_center)
描述信息一般是:
- 需要授权来创建色彩管理设备 / Authentication is required to create a color managed device
- 需要授权来移除色彩管理设备 / Authentication is required to remove a color managed device
- 刷新系统软件源需要认证 / Authentication is required to refresh the system repositories
解决方案
解决“色彩管理设备” / “color managed device” 弹窗
创建文件 /etc/polkit-1/localauthority/50-local.d/45-allow-colord.pkla
并写入内容:
[Allow Colord all Users]
Identity=unix-user:*
Action=org.freedesktop.color-manager.create-device;org.freedesktop.color-manager.create-profile;org.freedesktop.color-manager.delete-device;org.freedesktop.color-manager.delete-profile;org.freedesktop.color-manager.modify-device;org.freedesktop.color-manager.modify-profile
ResultAny=no
ResultInactive=no
ResultActive=yes
解决“刷新系统软件源需要认证” / “refresh the system repositories” 弹窗
创建文件 /etc/polkit-1/localauthority/50-local.d/46-allow-packagekit.pkla
并写入内容:
[Allow Refresh Repository all Users]
Identity=unix-user:*
Action=org.freedesktop.packagekit.system-sources-refresh
ResultAny=no
ResultInactive=no
ResultActive=yes
相关方法
以上解决方案可能有很多情况没有覆盖,可能有其他情况需要输入密码,此处描述解决方法。
需要认证跟 Polkit 有关系,可以在目录 /usr/share/polkit-1/actions
找到一堆 Policy 文件:
![Policy](https://img-blog.csdnimg.cn/20200909095126442.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3d1X3dlaWppZQ==,size_16,color_FFFFFF,t_70#pic_center)
以 “刷新系统软件源需要认证” 为例,搜索相关内容:
➜ actions grep "刷新系统软件源需要认证" *
org.freedesktop.packagekit.policy: <message xml:lang="zh_CN">刷新系统软件源需要认证</message>
根据搜索结果打开文件 org.freedesktop.packagekit.policy
![](https://img-blog.csdnimg.cn/20200909095439814.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3d1X3dlaWppZQ==,size_16,color_FFFFFF,t_70#pic_center)
以下内容表示默认需要管理员权限:
![在这里插入图片描述](https://img-blog.csdnimg.cn/20200909095759966.png#pic_center)
记录 Policy 文件内容中的 action id,参考上节解决方案中的配置文件内容:
[Allow Refresh Repository all Users]
Identity=unix-user:*
Action=org.freedesktop.packagekit.system-sources-refresh
ResultAny=no
ResultInactive=no
ResultActive=yes
Action 的值配置为 action id。
参考上节解决方案完成配置后,后续登录就无须再次输入密码。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)