Ubuntu Linux报错:PAM failed: Error in service module

文章目录

前言

环境:组装台式机Ubuntu20.04 TLS 64位系统
系统登陆不进行,查看相关日志报错为:

vim /var/log/syslog

日志:

Feb 27 23:40:18 i75930 systemd[1]: Created slice User Slice of UID 125.
Feb 27 23:40:18 i75930 systemd[1]: Starting User Runtime Directory /run/user/125...
Feb 27 23:40:18 i75930 systemd-logind[1252]: New session c1 of user gdm.
Feb 27 23:40:18 i75930 systemd[1]: Finished User Runtime Directory /run/user/125.
Feb 27 23:40:18 i75930 systemd[1]: Starting User Manager for UID 125...
Feb 27 23:40:18 i75930 systemd[1488]: pam_limits(systemd-user:session): cannot read settings from /etc/security/limits.d/clickhouse.conf: No such file or directory
Feb 27 23:40:18 i75930 systemd[1488]: pam_limits(systemd-user:session): error parsing the configuration file: 'pam_limits(systemd-user:session):'
Feb 27 23:40:18 i75930 systemd[1488]: PAM failed: Error in service module
Feb 27 23:40:18 i75930 systemd[1488]: pam_unix(systemd-user:session): session opened for user gdm by (uid=0)
Feb 27 23:40:18 i75930 systemd[1488]: user@125.service: Failed to set up PAM session: Operation not permitted
Feb 27 23:40:18 i75930 systemd[1488]: user@125.service: Failed at step PAM spawning /lib/systemd/systemd: Operation not permitted
Feb 27 23:40:18 i75930 systemd[1]: user@125.service: Main process exited, code=exited, status=224/PAM
Feb 27 23:40:18 i75930 systemd[1]: user@125.service: Failed with result 'exit-code'.
Feb 27 23:40:18 i75930 systemd[1]: Failed to start User Manager for UID 125.

解决

linux下pam模块是进行用户认证管理的,系统开机后,用户登陆之前先配置好用户session
即能我多少个终端同时连接,密码强度怎样,是否过期,哪些用户可以登陆图片界面等等

看报错我们可以知道pam启动失败是由pam_limits下一个文件没有找到引起的:

pam_limits(systemd-user:session): cannot read settings from /etc/security/limits.d/clickhouse.conf: No such file or directory

进入这个目录,发现它是一个软链接,但是它所指向的软链接根本不存在
把这个软链接删了,然后重启服务器问题解决

i75930# cd /etc/security/limits.d/
i75930# ll
lrwxrwxrwx root root 55 Feb 16 10:55 clickhouse.conf -> /opt/workspace/github/myconf/clickhouse/clickhouse.conf
i75930# cat clickhouse.conf
cat: clickhouse.conf: No such file or directory
i75930# cd /opt/workspace/github/myconf
total 48
drwxr-xr-x 3 wedo wedo 4.0K Feb 21 21:09 emacs
drwxr-xr-x 2 wedo wedo 4.0K Feb 21 21:09 for_test
drwxr-xr-x 6 wedo wedo 4.0K Feb 21 21:09 IntelliJ
drwxr-xr-x 3 wedo wedo 4.0K Feb 28 18:54 linux
drwxr-xr-x 4 wedo wedo 4.0K Feb 21 21:09 maven
drwxr-xr-x 6 wedo wedo 4.0K Feb 21 21:09 Notepad++
-rw-r--r-- 1 wedo wedo  401 Feb 21 21:09 README.org
drwxr-xr-x 3 wedo wedo 4.0K Feb 21 21:09 shell
drwxr-xr-x 2 wedo wedo 4.0K Feb 21 21:09 spacemacs
drwxr-xr-x 4 wedo wedo 4.0K Feb 21 21:09 VanDyke
drwxr-xr-x 5 wedo wedo 4.0K Feb 21 21:09 vim
drwxr-xr-x 3 wedo wedo 4.0K Feb 21 21:09 yong
drwxr-xr-x 2 wedo wedo 4.0K Feb 21 21:09 zsh
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值