0


centos7下升级openssh9.6版本以上远程连接报ssh服务器不能连接错误

解决方法:

1、在sshd_config文件添加如下配置

vim /etc/ssh/sshd_config

UsePAM yes

2、如果/etc/pam.d/sshd不存在,添加如下配置

vim /etc/pam.d/sshd

#%PAM-1.0
auth required pam_sepermit.so
auth substack password-auth
auth include postlogin

Used with polkit to reauthorize users in remote sessions

-auth optional pam_reauthorize.so prepare
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 required pam_namespace.so
session optional pam_keyinit.so force revoke
session include password-auth
session include postlogin

Used with polkit to reauthorize users in remote sessions

-session optional pam_reauthorize.so prepare

标签: ssh 服务器 运维

本文转载自: https://blog.csdn.net/xutengfei999/article/details/137861311
版权归原作者 xutengfei999 所有, 如有侵权,请联系我们删除。

“centos7下升级openssh9.6版本以上远程连接报ssh服务器不能连接错误”的评论:

还没有评论