su 不要求输入密码

com*_*ler 2 password root su

我的su不要求密码。当我运行su它时,它只是让我登录到root. 我试过su - root然后它要求输入密码。现在,正因为如此kdesu,无需密码即可运行具有 root 权限的应用程序。我尝试用su以下脚本替换

#!/bin/bash
/root/./su - root 
exit
Run Code Online (Sandbox Code Playgroud)

我把我的 su 移到了/root.

现在kdesu要求输入密码,但在我Enter输入密码后立即挂起。

我正在使用 Arch Linux。

jas*_*yan 5

由于man su笔记,/etc/pam.d/su是默认的PAM配置文件su。选项之一是为wheel组中的任何人授予隐式提升的权限:

# Uncomment the following line to implicitly trust users in the "wheel" group.
auth        sufficient  pam_wheel.so trust use_uid
Run Code Online (Sandbox Code Playgroud)

取消注释此行,当您su不带任何参数发出时,su默认以 root 身份运行交互式 shell,如果您的用户在wheel组中,则没有密码提示