#生产环境切记不要关闭当前窗口或保证telnet服务开启可以远程登录
1.在/etc/ssh/sshd_config中加入以下两行配置:
UsePAM yes
PasswordAuthentication yes
PermitRootLogin yes
替换更新后的/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
重启sshd服务解决
解决ssh7.4升级8.5后环境变量失效和无法登录问题
最新推荐文章于 2024-07-03 13:41:34 发布