设置特定用户免密码使用su命令


#1
  • 执行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

image

  • 保存退出

Partners Wiki IRC