码迷,mamicode.com
首页 > 系统相关 > 详细

linux 普通用户切换成root免密码

时间:2016-10-25 01:53:44      阅读:304      评论:0      收藏:0      [点我收藏+]

标签:pass   code   following   用户   comment   follow   count   登陆   密码   

 

[root@ok ~]# 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组
[root@ok ok]# usermod -G wheel ok
[ok@ok ~]$ su 
[root@ok ok]#
su直接切换成root

 

linux 普通用户切换成root免密码

标签:pass   code   following   用户   comment   follow   count   登陆   密码   

原文地址:http://www.cnblogs.com/bass6/p/5995092.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!