我有一台 Ubuntu 18.04 机器,有 2 个用户。两人都是管理员。第一个用户工作正常。第二个用户有一些系统设置显示为灰色,例如用于修改用户的解锁按钮。当我将鼠标悬停在它上面时,它会显示“系统策略阻止更改。请联系您的系统管理员”:
...以及用于修改打印机设置的解锁按钮,以及打印机设置本身——两者都是灰色的!
与日期和时间设置相同...解锁按钮显示为灰色并显示相同的消息。
怎么了?如何让用户 2 能够更改打印机设置或修改用户?他们是sudo
组的成员和管理员,所有这些设置都适用于用户 1。
也许与polkit有关?<--不知道这是什么,我一点也不明白。
更新:如果这些文件中的任何一个与问题有关,我有这些:
/usr/share/polkit-1$ tree
.
├── actions
│ ├── com.hp.hplip.policy
│ ├── com.ubuntu.apport.policy
│ ├── com.ubuntu.languageselector.policy
│ ├── com.ubuntu.release-upgrader.policy
│ ├── com.ubuntu.softwareproperties.policy
│ ├── com.ubuntu.systemservice.policy
│ ├── com.ubuntu.update-notifier.policy
│ ├── com.ubuntu.usbcreator.policy
│ ├── com.ubuntu.welcome.policy
│ ├── com.ubuntu.whoopsiepreferences.policy
│ ├── io.snapcraft.snapd.policy
│ ├── org.a11y.brlapi.policy
│ ├── org.debian.apt.policy
│ ├── org.dpkg.pkexec.update-alternatives.policy
│ ├── org.freedesktop.accounts.policy
│ ├── org.freedesktop.bolt.policy
│ ├── org.freedesktop.color.policy
│ ├── org.freedesktop.fwupd.policy
│ ├── org.freedesktop.hostname1.policy
│ ├── org.freedesktop.locale1.policy
│ ├── org.freedesktop.login1.policy
│ ├── org.freedesktop.ModemManager1.policy
│ ├── org.freedesktop.NetworkManager.policy
│ ├── org.freedesktop.packagekit.policy
│ ├── org.freedesktop.packagekit.system-network-proxy-configure.policy
│ ├── org.freedesktop.pkexec.nomachine.policy
│ ├── org.freedesktop.policykit.policy
│ ├── org.freedesktop.RealtimeKit1.policy
│ ├── org.freedesktop.resolve1.policy
│ ├── org.freedesktop.systemd1.policy
│ ├── org.freedesktop.timedate1.policy
│ ├── org.freedesktop.UDisks2.policy
│ ├── org.gnome.controlcenter.datetime.policy
│ ├── org.gnome.controlcenter.remote-login-helper.policy
│ ├── org.gnome.controlcenter.user-accounts.policy
│ ├── org.gnome.DejaDup.policy
│ ├── org.gnome.gparted.policy
│ ├── org.gnome.settings-daemon.plugins.power.policy
│ ├── org.gnome.settings-daemon.plugins.wacom.policy
│ ├── org.gtk.vfs.file-operations.policy
│ ├── org.kde.kio.file.policy
│ ├── org.nemo.root.policy
│ ├── org.opensuse.cupspkhelper.mechanism.policy
│ ├── org.xfce.thunar.policy
│ └── org.x.xf86-video-intel.backlight-helper.policy
└── rules.d
├── 20-gnome-initial-setup.rules
├── 60-network-manager.rules
├── geoclue-2.0.rules
├── gnome-control-center.rules
├── org.freedesktop.bolt.rules
├── org.freedesktop.fwupd.rules
├── org.freedesktop.packagekit.rules
├── org.gtk.vfs.file-operations.rules
└── systemd-networkd.rules
2 directories, 54 files
也可能相关:
来源:https ://www.admin-magazine.com/Articles/Assigning-Privileges-with-sudo-and-PolicyKit
相关,但似乎没有帮助:
- https://superuser.com/questions/980921/cant-unlock-system-settings-such-as-network-settings-to-edit-in-xubuntu
- 当通过 xRDP 会话连接时,我如何向能够解锁用户 GUI 以创建新用户的用户授予权限?
- https://www.linuxquestions.org/questions/slackware-14/system-policy-prevents-modification-of-network-settings-for-all-users-4175420519/
- ***** https://wiki.archlinux.org/index.php/Polkit
- https://www.freedesktop.org/software/polkit/docs/latest/polkit.8.html
- https://help.ubuntu.com/stable/ubuntu-help/user-admin-change.html.en - 对我不起作用 - 按钮变灰
- 如何从命令行创建管理员用户?- 似乎不是我需要的,我已经跑了
sudo usermod -aG sudo user2
,然后注销并重新登录,sudo
当我运行时,user2 现在显示为组之一groups
,但它仍然不起作用