您的位置:首页 > 运维架构

解决openssh,openssl升级出现的坑

2017-12-05 10:49 405 查看
http://blog.csdn.net/mayifan0/article/details/73293419

扫描测试服务器漏洞时,发现几个openssh的漏洞,准备把openssh和openssl的版本都升级到最新版。升级前建议使用telnet进行升级,防止期间出现问题连不上服务器

openssh-7.5p1,openssl-1.0.2l

这里一定要使用1.0.x的版本,不能用1.1.0x的版本。否则openssh的编译会报错: sshkey.c 错误:提领指向不完全类型的指针。在openssh的INSTALL文件里有说明要求安装的包的版本

安装过程就不写了,网上一大把。

如果在configure openssh时,如果有参数 –with-pam,会提示:

PAM is enabled. You may need to install a PAM control file for sshd, otherwise password authentication may fail. Example PAM control files can be found in the contrib/subdirectory

就是如果启用PAM,需要有一个控制文件,按照提示的路径找到redhat/sshd.pam,并复制到/etc/pam.d/sshd,在/etc/ssh/sshd_config中打开UsePAM yes。发现连接服务器被拒绝,关掉就可以登录。

查看 /var/log/secure, 发现



直接修改/etc/pam.d/sshd.pam为

#%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
1
2
3
4
5
6
7
8
9
10
11
12
13
重启sshd服务后,登录成功

版权声明:本文为博主原创文章,未经博主允许不得转载。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: