发布于 2016-09-17 00:26:01
在图形工作站的控制台上操作的用户注意到,可以执行多个程序,而不需要根身份验证或密码(如重新启动)。这个过程涉及到巧妙地使用在比最初设计的更广泛的上下文中应用的SUID程序/usr/sbin/userhelper
。
图形用户执行中间别名程序/usr/bin/consolehelper
,该程序根据特定的PAM ()配置授权操作,然后将命令发送到SUID程序以特权执行用户程序。如果用户没有适当的授权,则在用户的Linux环境下执行所请求的程序。
在当前部署的情况下,所需的用于重新引导的PAM配置文件包含对用户在控制台登录或当前在根环境下运行以抑制密码请求的检查。
发布于 2019-05-20 14:30:37
另一个解决办法是通过Polkit..。编辑/usr/share/polkit-1/actions/org.freedesktop.UDisks2.policy
世界各地的变化:
<defaults>
<allow_any>auth_admin</allow_any>
<allow_inactive>auth_admin</allow_inactive>
<allow_active>auth_admin_keep</allow_active>
</defaults>
..。有:
<defaults>
<allow_any>yes</allow_any>
<allow_inactive>yes</allow_inactive>
<allow_active>yes</allow_active>
</defaults>
否则,创建一个规则:编辑或创建:/etc/polkit-1/ rule es.d/50-udisks.Rule
polkit.addRule(function(action, subject) {
var YES = polkit.Result.YES;
var permission = {
// only required for udisks1:
"org.freedesktop.udisks.filesystem-mount": YES,
"org.freedesktop.udisks.filesystem-mount-system-internal": YES,
"org.freedesktop.udisks.luks-unlock": YES,
"org.freedesktop.udisks.drive-eject": YES,
"org.freedesktop.udisks.drive-detach": YES,
// only required for udisks2:
"org.freedesktop.udisks2.filesystem-mount": YES,
"org.freedesktop.udisks2.filesystem-mount-system": YES,
"org.freedesktop.udisks2.encrypted-unlock": YES,
"org.freedesktop.udisks2.eject-media": YES,
"org.freedesktop.udisks2.power-off-drive": YES,
// required for udisks2 if using udiskie from another seat (e.g. systemd):
"org.freedesktop.udisks2.filesystem-mount-other-seat": YES,
"org.freedesktop.udisks2.encrypted-unlock-other-seat": YES,
"org.freedesktop.udisks2.eject-media-other-seat": YES,
"org.freedesktop.udisks2.power-off-drive-other-seat": YES
};
if (subject.isInGroup("users")) {
return permission[action.id];
}
});
那就重新启动!
https://unix.stackexchange.com/questions/310442
复制相似问题