解决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为
2
3
4
5
6
7
8
9
10
11
12
13
重启sshd服务后,登录成功
版权声明:本文为博主原创文章,未经博主允许不得转载。
扫描测试服务器漏洞时,发现几个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-auth1
2
3
4
5
6
7
8
9
10
11
12
13
重启sshd服务后,登录成功
版权声明:本文为博主原创文章,未经博主允许不得转载。
相关文章推荐
- SuSe 11以编译安装的方式升级OpenSSH、OpenSSL及依赖问题解决
- 解决openssh漏洞,升级openssh版本
- 升级10.11后使用CocoaPod出现-bash: pod: command not found 解决办法 及其CocoaPod的安装
- 解决升级chrome后,访问https出现Your connection is not private
- 升级到mac 10.10之后使用pod出现问题的解决方法
- nginx升级到 0.8.53 之后,使用老的配置出现duplicate MIME type "text/html"问题的解决办法
- gdb和gcc升级:解决编译和调试时出现gdb no symbol in current context
- 升级内核后 出现initramfs错误问题解决
- 升级10.11后使用CocoaPod出现-bash: pod: command not found 解决办法-备
- VS2010升级VS2013后,出现没有定义类型“PowerPacks.ShapeContainer”错误解决方法
- Android Studio升级到3.3出现的问题-手动解决办法
- openssh和openssl升级
- openssl运行出现 no OPENSSL_Applink解决办法
- Redhat 6 升级 openssl-1.0.2m 、openssh-7.6p1 和 ntp-4.2.8p10
- 升级10.12后使用CocoaPod出现-bash: pod: command not found 解决办法
- Ubuntu升级出现/boot空间不足解决
- linux 内核编译时出现scripts/sign-file.c:25:30: fatal error: openssl/opensslv.h错误的解决办法
- 升级10.11后使用CocoaPod出现-bash: pod: command not found 解决办法
- 系统从很老的V12.4.X升级到V15.0.4中个别报表构建中出现的错误及解决办法
- 解决升级 npm 5 后出现的莫名其妙的 bug 的一些尝试