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

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

  • 保存退出
1 个赞

服务器资源由ZeptoVM赞助

Partners Wiki Discord