解决openssh,openssl升级出现的坑

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服务后,登录成功

版权声明:本文为博主原创文章,未经博主允许不得转载。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值