linux 普通用户切换成root免密码
Posted 运维工匠实战(如果发现有错误请大家把正确的方法发送给我,方便
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了linux 普通用户切换成root免密码相关的知识,希望对你有一定的参考价值。
[[email protected] ~]# vim /etc/pam.d/su
下面是/etc/pam.d/su文件的内容
1 #%PAM-1.0 2 auth sufficient pam_rootok.so 3 # Uncomment the following line to implicitly trust users in the "wheel" group. 4 #auth sufficient pam_wheel.so trust use_uid 5 # Uncomment the following line to require a user to be in the "wheel" group. 6 #auth required pam_wheel.so use_uid 7 auth include system-auth 8 account sufficient pam_succeed_if.so uid = 0 use_uid quiet 9 account include system-auth 10 password include system-auth 11 session include system-auth 12 session optional pam_xauth.so 将第4行的#号去掉,然后将登陆用户加入 wheel组 [[email protected] ok]# usermod -G wheel ok [[email protected] ~]$ su [[email protected] ok]# su直接切换成root
以上是关于linux 普通用户切换成root免密码的主要内容,如果未能解决你的问题,请参考以下文章