首页 > 系统相关 >Linux 无法从本地字符界面(tty1-tty6)登陆深度解析

Linux 无法从本地字符界面(tty1-tty6)登陆深度解析

时间:2023-06-25 14:33:41浏览次数:59  
标签:limits pam tty6 so tty1 Linux security root nec3


Linux 无法从本地字符界面(tty1-tty6)登陆深度解析

作者:吴伟龙(PrudentWoo)

 

问题描述:

        每次装完Oracle数据库之后,本地的tty1-tty6就无法登陆,只能通过vtty或tty7图形终端登陆。

 

问题现象:

          输入完用户名密码之后,自动弹回如下界面:

Linux 无法从本地字符界面(tty1-tty6)登陆深度解析_security

Linux 无法从本地字符界面(tty1-tty6)登陆深度解析_oracle_02



日志信息:

[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



后记:

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:










标签:limits,pam,tty6,so,tty1,Linux,security,root,nec3
From: https://blog.51cto.com/prudentwoo/6545728

相关文章

  • Linux使用HTTP代码示例
    以下是使用Linux命令行发送HTTP请求的示例:1.使用curl命令发送GET请求:```curl ExampleDomain```2.使用curl命令发送POST请求:```curl-XPOST-d"param1=value1&param2=value2" ExampleDomain```3.使用wget命令发送GET请求:```wget ExampleDomain```4.使用wget命令发送POST......
  • Linux Windows 双系统的一些问题
    时钟不一致问题https://sspai.com/post/55983定位到计算机\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation目录下,新建一个DWORD类型,名称为RealTimeIsUniversal的键,并修改键值为1即可。windows连不上网在设置-WLAN-管理已知网络,将wifi忘记,......
  • Linux下执行文件删除的操作{确认!确认! 确认!}
    ubuntu删除文件夹命令rm-r文件名字--->强制删除XXX文件 rm-f文件名字--->强制删除XXX文件(centos) 注: linux中,强制删除文件的命令是rm-f,但是在今天的服务器共享文件夹中,输入总是报错,网上一查,原来ubuntu中删除命令是rm-==特别注意,在Linux......
  • linux常见软件的环境搭建
    1、python环境搭建python:wegethttps://www.python.org/ftp/python/3.7.0/Python-3.7.0.tar.xztar-JxvfPython-3.7.0.tar.xzyum-yinstallzlib-develbzip2-developenssl-develncurses-develsqlite-develreadline-develtk-develgdbm-develdb4-devellibpcap-dev......
  • 【野火Linux移植篇】5-重温编译Linux内核命令 make xxx_defconfig 文件位置
    重温编译内核步骤:命令如下:makeARCH=armCROSS_COMPILE=arm-linux-gnueabihf-distcleanmakeARCH=armCROSS_COMPILE=arm-linux-gnueabihf-imx_v7_defconfigmakeARCH=armCROSS_COMPILE=arm-linux-gnueabihf-all-j16第一行命令用于清除工程中之前编译的残留文件,最好这......
  • 测试人员学习Linux
    1、Linux虚拟机IP地址冲突,修改后,重启网卡的命令是servicenetworkrestart2、修改/home/hzntest文件的权限,使所属用户有所有权限,所属组有可读可写的权限,其他只有可读的权限chmod-R764/home/hzntest3、将/home/hzn/hzn.tar.gz文件解压到/hzn/test目录下的命令tar-zxvf/home/......
  • Linux操作系统怎么使用Windows下的字体
    Linux系统如果需要使用Windows下字体可以使用以下方法例如Linux下应用WPS需要使用微软雅黑字体则首先到windows下的目录C:\Windows\Fonts找到微软雅黑字体右键复制微软雅黑字体,会复制三个字体文件把这三个文件复制到Linux系统的以下目录/usr/share/fonts/wps-office重启......
  • linux运维基础
    1、时间同步方案1:ntpdateasia.pool.ntp.org时间校准、时间同步  方案2:#!/bin/bash#安装chrony:yuminstall-ychrony#注释默认ntp服务器sed-i's/^server/#&/'/etc/chrony.conf#指定上游公共ntp服务器,并容许其余节点同步时间cat>>/etc/chrony.conf<<......
  • Linux 安装/卸载 MySQL 8.0
    Linux安装/卸载MySQL8.0原创 默存 全栈客 2023-06-1511:14 发表于甘肃收录于合集#linux1个#mysql1个安装Centos安装MySQL8.0操作系统环境[root@t2 local]# hostnamectlStatic hostname: hadoop-masterIcon name: computer-desktopChassis: de......
  • linux dmesg
    简介dmesgisusedtoexamineorcontrolthekernelringbuffer.Thedefaultactionistodisplayallmessagesfromthekernelringbuffer.Linux内核启动时会加载硬件驱动,在有新硬件时也会加载驱动,如果想要查看内核的活动,可以使用dmesg命令。Linux内核日志存储在......