#%PAM-1.0
auth sufficient pam_rootok.so
# Uncomment the following line to implicitly trust users in the "wheel" group.#将这一行的#去掉,取消注释
auth sufficient pam_wheel.so trust use_uid
# Uncomment the following line to require a user to be in the "wheel" group.#au
auth include system-auth
account sufficient pam_succeed_if.so uid =0 use_uid quiet
account include system-auth
password include system-auth
session include system-auth
session optional pam_xauth.so
# 将普通用户添加到wheel组中usermod -G wheel info12
2、使用ssh或telnet登陆后如何自动切换root
su info12
cdvim .bash_profile
# .bash_profile# Get the aliases and functionsif[ -f ~/.bashrc ];then. ~/.bashrc
fisudosu - root #加入这么一个授权的命令# User specific environment and startup programsPATH=$PATH:$HOME/bin
exportPATH
su root
vim /etc/sudoers
root ALL=(ALL) ALL
chenfei ALL=(ALL) NOPASSWD: ALL #在root后面添加普通用户
免密切换1、免密切换root用户的方法2、使用ssh或telnet登陆后如何自动切换root1、免密切换root用户的方法su rootvim /etc/pam.d/su#%PAM-1.0auth sufficient pam_rootok.so# Uncomment the following line to implicitly trust users in the "wheel" group.#将这一行的#去掉,取消注释auth