- 执行
su
切换到root权限: - 执行
groupadd wheel
创建group:wheel -
usermod -G wheel your_user_name
将你的普通用户添加到wheel组 -
vim /etc/pam.d/su
编辑配置文件找到如下位置
去掉第三行的注释符
# Uncomment this if you want wheel members to be able to
# su without a password.
# auth sufficient pam_wheel.so trust
# Uncomment this if you want wheel members to be able to
# su without a password.
auth sufficient pam_wheel.so trust
- 保存退出