Linux Openssl升级
问题描述:例如CentOS 7.X的操作系统下,会报openssh相关漏洞,需要升级处理;
解决办法:
1.查看linux服务器当前OpenSSH版本
ssh -V
3.解压升级包
tar --no-same-owner -zxvf zlib-1.2.11.tar.gz
tar --no-same-owner -zxvf openssh-8.3p1.tar.gz
tar --no-same-owner -zxvf openssl-1.1.1g.tar.gz
4.编译安装zlib
cd zlib-1.2.11
./configure --prefix=/usr/local/zlib
make && make install
5.编译安装openssl
cd openssl-1.1.1g
./config --prefix=/usr/local/ssl -d shared
make && make install
echo '/usr/local/ssl/lib' >> /etc/ld.so.conf
ldconfig -v
6.安装openssh
cd openssh-8.3p1
./configure --prefix=/usr/local/openssh --with-zlib=/usr/local/zlib --with-ssl-dir=/usr/local/ssl
make && make install
7.备份原有文件,并将新的配置复制到指定目录
复制代码
mv /etc/ssh/sshd_config /etc/ssh/sshd_config.bak
cp /usr/local/openssh/etc/sshd_config /etc/ssh/sshd_config
mv /usr/sbin/sshd /usr/sbin/sshd.bak
cp /usr/local/openssh/sbin/sshd /usr/sbin/sshd
mv /usr/bin/ssh /usr/bin/ssh.bak
cp /usr/local/openssh/bin/ssh /usr/bin/ssh