报错信息

操作系统:Oracle Linux 7.8

● sshd.service - SYSV: OpenSSH server daemon
   Loaded: loaded (/etc/rc.d/init.d/sshd; bad; vendor preset: enabled)
   Active: active (running) since Fri 2024-01-26 10:50:01 CST; 18min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 4384 ExecStop=/etc/rc.d/init.d/sshd stop (code=exited, status=0/SUCCESS)
  Process: 4393 ExecStart=/etc/rc.d/init.d/sshd start (code=exited, status=0/SUCCESS)
 Main PID: 4402 (sshd)
    Tasks: 1
   CGroup: /system.slice/sshd.service
           └─4402 sshd: /usr/sbin/sshd [listener] 0 of 10-100 startup

Jan 26 10:50:01 recovery sshd[4402]: Server listening on :: port 22.
Jan 26 10:50:01 recovery sshd[4393]: Starting sshd:[  OK  ]
Jan 26 10:50:01 recovery systemd[1]: Started SYSV: OpenSSH server daemon.
Jan 26 10:50:15 recovery sshd[4496]: PAM unable to dlopen(/usr/lib64/security/pam_stack.so): /usr/lib64/security/pam_stack.so: cannot open shared object file: No such file or directory
Jan 26 10:50:15 recovery sshd[4496]: PAM adding faulty module: /usr/lib64/security/pam_stack.so
Jan 26 10:50:15 recovery sshd[4496]: Failed password for root from 10.85.65.123 port 55020 ssh2
Jan 26 10:50:21 recovery sshd[4496]: Connection closed by authenticating user root 10.85.65.123 port 55020 [preauth]
Jan 26 10:59:25 recovery sshd[5289]: PAM unable to dlopen(/usr/lib64/security/pam_stack.so): /usr/lib64/security/pam_stack.so: cannot open shared object file: No such file or directory
Jan 26 10:59:25 recovery sshd[5289]: PAM adding faulty module: /usr/lib64/security/pam_stack.so
Jan 26 10:59:25 recovery sshd[5289]: Failed password for root from 10.85.65.123 port 36116 ssh2

修复过程

修改文件/etc/pam/sshd

#%PAM-1.0
auth       required     pam_sepermit.so
auth       include      password-auth
account    required     pam_nologin.so
account    include      password-auth
password   include      password-auth
# pam_selinux.so close should be the first session rule
session    required     pam_selinux.so close
session    required     pam_loginuid.so
# pam_selinux.so open should only be followed by sessions to be executed in the user context
session    required     pam_selinux.so open env_params
session    optional     pam_keyinit.so force revoke
session    include      password-auth

重启服务

systemctl restart ssh
最后修改:2024 年 05 月 11 日
如果觉得我的文章对你有用,请随意赞赏