我们要求使用特殊脚本添加用户,因此应该阻止通过GUI添加用户(即gnome-control-center user-accounts),以防止有人意外地不使用该脚本。
这有可能吗?完全删除gnome-control-center不是一种选择。Ubuntu版本目前为20.04。
发布于 2020-10-03 17:57:08
一个基本的想法是改变polkit政策。
编辑文件/usr/share/polkit-1/actions/org.freedesktop.accounts.policy
sudo -H gedit /usr/share/polkit-1/actions/org.freedesktop.accounts.policy编辑内容:
<action id="org.freedesktop.accounts.user-administration">
.........
.........
.........
<defaults>
<allow_any>none</allow_any>
<allow_inactive>none</allow_inactive>
<allow_active>none</allow_active>
</defaults>
</action>我用none编辑了3行
在3.38.0中测试

以上只是一个想法..。您可以进一步挖掘相同文件的本地化位置,以防止更新中的覆盖。
https://askubuntu.com/questions/1279766
复制相似问题