openssh openssl zlib 升级至最新版解决安全问题

本文提供了一种升级openssh、openssl及zlib的方法,以提高系统的SSH安全性。首先升级zlib到1.2.11版本,然后升级openssl到1.1.1版本,最后将openssh升级到8.4版本,并配置相关参数。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

解决openssh openssl zlib 安全问题

openssh在github上下载
https://github.com/openssh/openssh-portable/releases
openssl官网下载
https://www.openssl.org/source/
zlib下载
http://www.zlib.net/zlib-1.2.11.tar.gz
分享的源码包
链接:https://pan.baidu.com/s/1mtfoWtz0hZda6R2WFGf4hg
提取码:i1do
先升级zib,再升openssh openssl

zlib升级1.2.11
tar xf zlib-1.2.11.tar.gz
cd zlib-1.2.11
./configure --prefix=/usr
make && make install

openssl升级1.1.1版本

yum -y install xinetd telnet-server
for i in {0..2};do echo "pts/$i" >> /etc/securetty;done
systemctl restart telnet.socket
systemctl restart xinetd
systemctl enable telnet.socket
systemctl enable xinetd
ss -lntp|grep 23
mv /usr/bin/openssl /usr/bin/openssl.bak
mv /usr/include/openssl /usr/include/openssl.bak
echo "/usr/local/lib64" >> /etc/ld.so.conf
tar xf openssl-1.1.1g.tar.gz
cd openssl-1.1.1g/
yum -y install gcc gcc-c++ glibc make autoconf openssl openssl-devel pcre-devel pam-devel
./config --prefix=/usr shared zlib && make && make install
ldconfig -v
openssl version
OpenSSL 1.1.1g  21 Apr 2020

openssh升级8.4

tar xf openssh-8.4p1.tar.gz
rm -rf /etc/ssh/* /usr/lib/systemd/system/sshd.service
cd openssh-8.4p1
./configure --prefix=/usr/ --sysconfdir=/etc/ssh --with-ssl --with-zlib --with-md5-passwords --with-pam && make && make install
echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
echo "KexAlgorithms diffie-hellman-group1-sha1,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group-exchange-sha256,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group1-sha1" >> /etc/ssh/sshd_config
cp -a contrib/redhat/sshd.init /etc/init.d/sshd && chmod +x /etc/init.d/sshd && cp -a contrib/redhat/sshd.pam /etc/pam.d/sshd.pam && chkconfig --add sshd
chkconfig sshd on
systemctl restart sshd
ssh -V

在这里插入图片描述
如果升级成功后发现后台不能保留守护进程,程序开启后退出ssh远程登录后不能保持存活状态,重启sshd服务即可

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值