Linux 无法从本地字符界面(tty1-tty6)登陆深度解析
2016-12-13 12:47
387 查看
Linux 无法从本地字符界面(tty1-tty6)登陆深度解析作者:吴伟龙(PrudentWoo)
问题描述:
每次装完Oracle数据库之后,本地的tty1-tty6就无法登陆,只能通过vtty或tty7图形终端登陆。
问题现象:
输入完用户名密码之后,自动弹回如下界面:
![](https://img-blog.csdn.net/20161213130216574?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvd3V3ZWlsb25n/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center)
![](https://img-blog.csdn.net/20161213130148614?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvd3V3ZWlsb25n/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center)
日志信息:[root@nec3 ~]# tail -f /var/log/messages
Dec 13 09:27:58 nec3 init: tty (/dev/tty1) main process ended, respawning
Dec 13 09:28:03 nec3 init: tty (/dev/tty1) main process (2782) terminated with status 1
Dec 13 09:28:03 nec3 init: tty (/dev/tty1) main process ended, respawning
Dec 13 09:28:43 nec3 init: tty (/dev/tty1) main process (2787) terminated with status 1
Dec 13 09:28:43 nec3 init: tty (/dev/tty1) main process ended, respawning
Dec 13 09:29:51 nec3 init: tty (/dev/tty1) main process (2793) terminated with status 1
Dec 13 09:29:51 nec3 init: tty (/dev/tty1) main process ended, respawning
我们可以从上面的message日志中看到本地tty1登陆的这个动作,但是没有报错,那么登陆无非要去进行用户名和密码验证,那么用户密码验证信息会记录在名为secure的日志中,如果报密码错误日志中会显示验证失败,日志条目为:FAILED LOGIN 1FROM (null) FOR root, Authentication failure。
实际上我们在secure日志中看到的信息是Moduleis unknow以及无法打开pam_limits.so模块。
[root@nec3 ~]# tail -f /var/log/secure
Dec 13 09:28:03 nec3 login: pam_unix(login:session): session opened for user root by LOGIN(uid=0)
Dec 13 09:28:03 nec3 login: Module is unknown
Dec 13 09:28:08 nec3 login: PAM unable to dlopen(/lib/security/pam_limits.so): /lib/security/pam_limits.so: cannot open shared object file: No such file or directory
Dec 13 09:28:08 nec3 login: PAM adding faulty module: /lib/security/pam_limits.so
Dec 13 09:28:43 nec3 login: pam_unix(login:session): session opened for user root by LOGIN(uid=0)
Dec 13 09:28:43 nec3 login: Module is unknown
日志分析:
根据上面的日志条目中我们可以看到有无效模块,而这个无效的模块信息是我们在数据库安装过程中添加到/etc/pam.d/login配置文件中的,我现在需要判断下这个模块是否存在,为什么需要这个模块。
[root@nec3 ~]# grep pam_limits /etc/pam.d/login
session required /lib/security/pam_limits.so
[root@nec3 ~]# ls -rtl /lib
lib/ lib64/
[root@nec3 ~]# ls -rtl /lib/security/pam*
ls: cannot access /lib/security/pam*: No such file or directory
那么我们可以看到该模块是不存在的,随即我们再看下lib64这个目录中是否有oracle安装所需的该模块。
[root@nec3 ~]# ls -rtl /lib64/security/pam_limits.so
-rwxr-xr-x. 1 root root 18592 Oct 7 2013 /lib64/security/pam_limits.so
那么我们可以清楚的看到在这里是存在这个模块的。
问题处理:
既然已经看到问题的原因,那么将会有如下三个解决方案:
1、拷贝条目:
[root@nec3 ~]# cp /lib64/security/pam_limits.so /lib/security/pam_limits.so
[root@nec3 ~]# ls -rtl /lib/security/pam_limits.so
-rwxr-xr-x. 1 root root 18592 Oct 7 2013 /lib/security/pam_limits.so
2、ln pam_limits.so
[root@nec3 ~]# ln -s /lib64/security/pam_limits.so /lib/security/pam_limits.so
3、修改配置文件login为如下:
[root@nec3 ~]# grep pam_limits /etc/pam.d/login
session required /lib64/security/pam_limits.so
后记:
文中提到为什么要用pam_limits.so这个模块,因为我们在配置Oracle部署环境的时候配置了limits.conf
限制文件,那么我们要使这个配置生效,必须要确保pam_limits.so被加入到登陆配置文件中应用生效。
参考:
https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/5/html/Tuning_and_Optimizing_Red_Hat_Enterprise_Linux_for_Oracle_9i_and_10g_Databases/chap-Oracle_9i_and_10g_Tuning_Guide-Setting_Shell_Limits_for_the_Oracle_User.html
That these limits work you also needto ensure that pam_limits isconfigured in the /etc/pam.d/system-auth file, or in/etc/pam.d/sshd for ssh, /etc/pam.d/su for su, or /etc/pam.d/login for localaccess and telnet and disabletelnet for all log in methods. Here are examples of the two session entries inthe /etc/pam.d/system-auth file:
问题描述:
每次装完Oracle数据库之后,本地的tty1-tty6就无法登陆,只能通过vtty或tty7图形终端登陆。
问题现象:
输入完用户名密码之后,自动弹回如下界面:
日志信息:[root@nec3 ~]# tail -f /var/log/messages
Dec 13 09:27:58 nec3 init: tty (/dev/tty1) main process ended, respawning
Dec 13 09:28:03 nec3 init: tty (/dev/tty1) main process (2782) terminated with status 1
Dec 13 09:28:03 nec3 init: tty (/dev/tty1) main process ended, respawning
Dec 13 09:28:43 nec3 init: tty (/dev/tty1) main process (2787) terminated with status 1
Dec 13 09:28:43 nec3 init: tty (/dev/tty1) main process ended, respawning
Dec 13 09:29:51 nec3 init: tty (/dev/tty1) main process (2793) terminated with status 1
Dec 13 09:29:51 nec3 init: tty (/dev/tty1) main process ended, respawning
我们可以从上面的message日志中看到本地tty1登陆的这个动作,但是没有报错,那么登陆无非要去进行用户名和密码验证,那么用户密码验证信息会记录在名为secure的日志中,如果报密码错误日志中会显示验证失败,日志条目为:FAILED LOGIN 1FROM (null) FOR root, Authentication failure。
实际上我们在secure日志中看到的信息是Moduleis unknow以及无法打开pam_limits.so模块。
[root@nec3 ~]# tail -f /var/log/secure
Dec 13 09:28:03 nec3 login: pam_unix(login:session): session opened for user root by LOGIN(uid=0)
Dec 13 09:28:03 nec3 login: Module is unknown
Dec 13 09:28:08 nec3 login: PAM unable to dlopen(/lib/security/pam_limits.so): /lib/security/pam_limits.so: cannot open shared object file: No such file or directory
Dec 13 09:28:08 nec3 login: PAM adding faulty module: /lib/security/pam_limits.so
Dec 13 09:28:43 nec3 login: pam_unix(login:session): session opened for user root by LOGIN(uid=0)
Dec 13 09:28:43 nec3 login: Module is unknown
日志分析:
根据上面的日志条目中我们可以看到有无效模块,而这个无效的模块信息是我们在数据库安装过程中添加到/etc/pam.d/login配置文件中的,我现在需要判断下这个模块是否存在,为什么需要这个模块。
[root@nec3 ~]# grep pam_limits /etc/pam.d/login
session required /lib/security/pam_limits.so
[root@nec3 ~]# ls -rtl /lib
lib/ lib64/
[root@nec3 ~]# ls -rtl /lib/security/pam*
ls: cannot access /lib/security/pam*: No such file or directory
那么我们可以看到该模块是不存在的,随即我们再看下lib64这个目录中是否有oracle安装所需的该模块。
[root@nec3 ~]# ls -rtl /lib64/security/pam_limits.so
-rwxr-xr-x. 1 root root 18592 Oct 7 2013 /lib64/security/pam_limits.so
那么我们可以清楚的看到在这里是存在这个模块的。
问题处理:
既然已经看到问题的原因,那么将会有如下三个解决方案:
1、拷贝条目:
[root@nec3 ~]# cp /lib64/security/pam_limits.so /lib/security/pam_limits.so
[root@nec3 ~]# ls -rtl /lib/security/pam_limits.so
-rwxr-xr-x. 1 root root 18592 Oct 7 2013 /lib/security/pam_limits.so
2、ln pam_limits.so
[root@nec3 ~]# ln -s /lib64/security/pam_limits.so /lib/security/pam_limits.so
3、修改配置文件login为如下:
[root@nec3 ~]# grep pam_limits /etc/pam.d/login
session required /lib64/security/pam_limits.so
后记:
文中提到为什么要用pam_limits.so这个模块,因为我们在配置Oracle部署环境的时候配置了limits.conf
限制文件,那么我们要使这个配置生效,必须要确保pam_limits.so被加入到登陆配置文件中应用生效。
参考:
https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/5/html/Tuning_and_Optimizing_Red_Hat_Enterprise_Linux_for_Oracle_9i_and_10g_Databases/chap-Oracle_9i_and_10g_Tuning_Guide-Setting_Shell_Limits_for_the_Oracle_User.html
That these limits work you also needto ensure that pam_limits isconfigured in the /etc/pam.d/system-auth file, or in/etc/pam.d/sshd for ssh, /etc/pam.d/su for su, or /etc/pam.d/login for localaccess and telnet and disabletelnet for all log in methods. Here are examples of the two session entries inthe /etc/pam.d/system-auth file:
相关文章推荐
- X64 Linux 无法从本地字符界面登陆。
- X64 Linux无法从本地字符界面登陆解决
- X64 Linux 无法从本地字符界面登陆
- X64 Linux 无法从本地字符界面登陆
- 【转】X64 Linux无法从本地字符界面登陆解决
- X64 Linux 无法从本地字符界面登陆
- X64位linux本地字符界面无法登录问题解决
- Linux 无法从字符界面登陆 F1-F6
- linux 本地账号密码无法登陆(shell可以登录),一直返回 登陆的login界面
- Linux 无法从字符界面登陆 闪退
- linux 本地账号密码无法登陆(shell可以登录),一直返回 登陆的login界面
- Linux本地采用字符界面的方式登录不成功--问题已解决
- 解决Linux系统输入登陆密码正确,但闪回登陆界面,无法登录的问题
- Linux安装完Tomcat后无法登陆管理界面
- Linux输入登陆密码正确 闪回登陆界面 无法登录
- linux X界面 输入密码正确,但是无法登陆系统,命令行界面可以登陆
- linux 本地账号密码无法登陆,一直返回 登陆的login界面
- linux X界面 输入密码正确,但是无法登陆系统,命令行界面可以登陆
- linux字符界面下root用户无法登录成功
- [Linux] Ubuntu: 登陆界面无法输入密码