<b style="">问题现象:</b><p><span style="color: rgb(51, 51, 51); background-color: rgb(255, 255, 255);">麒麟V10 SP1服务器版本minimal install之后,通过yum groupinstall “Server with UKUI GUI”安装图形界面,图形界面root用户无法登录问题,</span><span style="color: rgb(51, 51, 51); background-color: rgb(255, 255, 255);">但ssh可正常登录,</span><span style="color: rgb(51, 51, 51); background-color: rgb(255, 255, 255);">具体现象是输入正确的用户名和密码后,仍旧提示密码错误,见下图</span><br></p><p><img style="max-width:100%" src="https://cdn2.cnxclm.com/187_20211004124614_1.jpg" alt="Image"><span style="color: rgb(51, 51, 51); background-color: rgb(255, 255, 255);"><br></span></p><p><span style="color: rgb(51, 51, 51); background-color: rgb(255, 255, 255);"><br></span></p><p><font color="#333333"><span style="background-color: rgb(255, 255, 255);">原因分析:</span></font></p><p><span style="color: rgb(51, 51, 51); background-color: rgb(255, 255, 255);">查看/var/log/secure日志,有如下输出</span><font color="#333333"><span style="background-color: rgb(255, 255, 255);"><br></span></font></p><p></p>- <font face="Microsoft YaHei" size="3">Oct 4 20:04:25 localhost lightdm[9168]: pam_unix(lightdm:auth): check pass; user unknown
- Oct 4 20:04:25 localhost lightdm[9168]: pam_unix(lightdm:auth): authentication failure; logname= uid=0 euid=0 tty=:0 ruser= rhost=
- Oct 4 20:04:25 localhost lightdm[9168]: pam_faillock(lightdm:auth): User unknown: root
- Oct 4 20:04:27 localhost lightdm[9201]: PAM unable to dlopen(/usr/lib64/security/pam_console.so): /usr/lib64/security/pam_console.so: cannot open shared object file: No such file or directory
- Oct 4 20:04:27 localhost lightdm[9201]: PAM adding faulty module: /usr/lib64/security/pam_console.so
- Oct 4 20:04:27 localhost lightdm[9201]: pam_faillock(lightdm:auth): User unknown: root</font>
复制代码 <span style="color: rgb(51, 51, 51); background-color: rgb(255, 255, 255);">根据报错信息”/usr/lib64/security/pam_console.so: cannot open shared object file: No such file or directory“,报pam_console.so文件不存在,查看确实不存在,</span><br><p></p><p></p>- <font face="Microsoft YaHei" size="3">[root@localhost ~]# ls -rlt /usr/lib64/security/pam_console.so
- ls: cannot access ‘/usr/lib64/security/pam_console.so’: No such file or directory
- [root@localhost ~]#</font>
复制代码 <span style="color: rgb(51, 51, 51); background-color: rgb(255, 255, 255);">同时检查登录正常的设备,文件也不存在,对比了正常设备vs异常设备的配置文件/etc/pam.d/login,均一样</span><br style="box-sizing: border-box; color: rgb(51, 51, 51); background-color: rgb(255, 255, 255);"><span style="color: rgb(51, 51, 51); background-color: rgb(255, 255, 255);">/etc/pam.d/login文件内容:</span><br><p></p><p></p>- <font face="Microsoft YaHei" size="3">#%PAM-1.0
- auth substack system-auth
- auth include postlogin
- account required pam_nologin.so
- account include system-auth
- password include system-auth
- # pam_selinux.so close should be the first session rule
- session required pam_selinux.so close
- session required pam_loginuid.so
- session optional pam_console.so
- # pam_selinux.so open should only be followed by sessions to be executed in the user context
- session required pam_selinux.so open
- session required pam_namespace.so
- session optional pam_keyinit.so force revoke
- session include system-auth
- session include postlogin
- -session optional pam_ck_connector.so</font>
复制代码 <b>解决方案:</b><p></p><p><span style="color: rgb(51, 51, 51); white-space: pre-wrap; background-color: rgb(255, 255, 255);">将login文件中的:</span><br style="box-sizing: border-box; color: rgb(51, 51, 51); white-space: pre-wrap; background-color: rgb(255, 255, 255);"><span style="color: rgb(51, 51, 51); white-space: pre-wrap; background-color: rgb(255, 255, 255);">session optional pam_console.so</span><br style="box-sizing: border-box; color: rgb(51, 51, 51); white-space: pre-wrap; background-color: rgb(255, 255, 255);"><span style="color: rgb(51, 51, 51); white-space: pre-wrap; background-color: rgb(255, 255, 255);">注释掉,重启问题解决。</span><br></p><p><span style="color: rgb(51, 51, 51); white-space: pre-wrap; background-color: rgb(255, 255, 255);"><br></span></p><p><span style="color: rgb(51, 51, 51); white-space: pre-wrap; background-color: rgb(255, 255, 255);"><b>补充信息:</b></span></p><p></p><p style="box-sizing: border-box; margin-bottom: 16px; white-space: pre-wrap; color: rgb(51, 51, 51);">在RedHat官网知识库中查询相关字眼发现了几个比较相似的帖子:</p><p style="box-sizing: border-box; margin-bottom: 16px; white-space: pre-wrap; color: rgb(51, 51, 51);">1、Unable to login via console with error: “PAM adding faulty module: /lib/security/pam_limits.so”<br style="box-sizing: border-box;"><a href="https://access.redhat.com/solutions/462963" style="box-sizing: border-box; background-image: initial; background-position: 0px 0px; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; outline: 0px; cursor: pointer; transition: color 0.3s ease 0s; color: rgb(65, 131, 196); touch-action: manipulation;">https://access.redhat.com/solutions/462963</a><br style="box-sizing: border-box;">2、Cannot log into system, receiving PAM errors in /var/log/secure<br style="box-sizing: border-box;"><a href="https://access.redhat.com/solutions/284653" style="box-sizing: border-box; background-image: initial; background-position: 0px 0px; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; outline: 0px; cursor: pointer; transition: color 0.3s ease 0s; color: rgb(65, 131, 196); touch-action: manipulation;">https://access.redhat.co</a><img style="max-width:100%" src="https://cdn2.cnxclm.com/187_20211004124845_1.jpg" alt="Image"><a href="https://access.redhat.com/solutions/284653" style="box-sizing: border-box; background-image: initial; background-position: 0px 0px; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; outline: 0px; cursor: pointer; transition: color 0.3s ease 0s; color: rgb(65, 131, 196); touch-action: manipulation;">m/solutions/284653</a></p><p style="box-sizing: border-box; white-space: pre-wrap; color: rgb(51, 51, 51);">但均未找到pam_console.so模块问题,一般是pam_linux.so、pam_limits.so问题,Redhat给出的解决方案就是注释掉相关报错模块的配置信息。</p><p></p><p><span style="color: rgb(51, 51, 51); background-color: rgb(255, 255, 255);"><br></span></p><p><img style="max-width:100%" src="https://cdn2.cnxclm.com/187_20211004124852_1.jpg" alt="Image"><span style="color: rgb(51, 51, 51); font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Monaco, monospace, Tahoma, STXihei, 华文细黑, STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, 宋体, Heiti, 黑体, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255);"><br></span></p> |
|