Linux su 命令的管理

一、su权限管理

非root账户能否su到root,通过/etc/pam.d/su管理

# Uncomment the following line to require a user to be in the "wheel" group.
# auth            required        pam_wheel.so use_uid

取消注释之后,所有其他用户只有在wheel组的才能su到root


二、更改组的命令

usermod -g wheel username

-g 更改用户登陆时所在的组

-G 添加其他不是登陆首选的组


/etc/login.defs


三、(补充)su时是否需要密码

# Uncomment the following line to implicitly trust users in the "wheel" group.
#auth           sufficient      pam_wheel.so trust use_uid

注释后需要root密码

不注释则wheel组可以无密码直接su到root


你可能感兴趣的:(linux,用户,su)