Centos 6.3 openssh升级(安全漏洞修复)
方法/步骤
注意:先多开几个crt客户端,就算过程中ssh安装失败,也还可以操作服务器,不会中断
1 准备
(1)下载安装包
https://www.openssl.org/source/openssl-1.0.2l.tar.gz
https://mirrors.evowise.com/pub/OpenBSD/OpenSSH/portable/openssh-7.5p1.tar.gz
(2)安装包
yum -y install gcc* make perl pam pam-devel zlib zlib-devel
2 升级openssl
(1)备份当前openssl文件
find / -name openssl
mv /usr/lib64/openssl/usr/lib64/openssl.old
mv /usr/bin/openssl/usr/bin/openssl.old
cp /usr/lib64/libcrypto.so.10 /usr/lib64/libcrypto.so.10.old
cp /usr/lib64/libssl.so.10 /usr/lib64/libssl.so.10.old
(2)卸载当前openssl
rpm -e `rpm -qa | grep openssl` --nodeps
rpm -qa | grep openssl
(3)进入解压的文件目录并编译安装
cd openssl-1.0.2k
编译文件
./config --prefix=/usr--openssldir=/etc/ssl --shared zlib
make
make install
查看是否升级成功
openssl version -a
==============================================
3 升级openssh
(1)停止当前ssh服务,并备份
service sshd stop---停止服务
mv /etc/ssh /etc/ssh.old----备份服务
(2)查询并卸载openssh
先卸载完旧版本的openssh
rpm -e `rpm -qa | grep openssh` --nodeps (yumremove openssh* -y)
cd openssh-7.5p1
编译
./configure --prefix=/usr --sysconfdir=/etc/ssh --with-md5-passwords --with-pam--with-ssh1 --with-zlib
--with-openssl-includes=/usr--with-privsep-path=/var/lib/sshd
make
make install
(3)安装后环境配置
cp ./contrib/redhat/sshd.init /etc/init.d/sshd
chmod +x /etc/init.d/sshd
chkconfig --add sshd
chkconfig --list |grep sshd
chkconfig sshd on
service sshd start
ssh -V
出现如下提示说明ssh升级成功,现在的openssh版本为OpenSSH_7.5p1,openssl版本为OpenSSL 1.0.2k
----------------------------------------------------------
vim /etc/ssh/sshd_config
添加PermitRootLogin yes
到文件末尾
service sshd restart
4 若失败,可以重新安装OpenSSH
CentOS 6 安装OpenSSH Server
yum install openssh-server
yum -y install openssh-clients
chkconfig --list sshd
chkconfig sshd on
/etc/init.d/sshd start
原文链接:https://www.f2er.com/centos/376666.html