准备软件包:
openssl-1.0.2j.tar.gz
openssh-7.4p1.tar.gz
一、升级openssl到openssl-1.0.2j
mv /usr/bin/openssl /usr/bin/openssl_bak
mv /usr/include/openssl /usr/include/openssl_bak
tar zxvf openssl-1.0.2j.tar.gz
cd openssl-1.0.2j/
./config --prefix=/usr/local/openssl_1.0.2j --shared
make && make install
ln -s /usr/local/openssl_1.0.2j/bin/openssl /usr/bin/openssl
ln -s /usr/local/openssl_1.0.2j/include/openssl/ /usr/include/openssl
echo "/usr/local/openssl_1.0.2j/lib" >> /etc/ld.so.conf
chmod 755 -R /usr/local/openssl_1.0.2j/
ldconfig -v
openssl version -a
二、升级openssh到openssh-7.4p1
mv /etc/ssh/ /etc/ssh_bak
mv /etc/init.d/sshd /etc/init.d/sshd_bak
cd ..
tar zxvf openssh-7.4p1.tar.gz
cd openssh-7.4p1/
./configure --prefix=/usr --sysconfdir=/etc/ssh --with-pam --with-zlib --with-ssl-
dir=/usr/local/openssl_1.0.2j/ --with-md5-passwords --mandir=/usr/share/man
make && make install
\cp -f contrib/redhat/sshd.init /etc/init.d/sshd
sed -i '/\/sbin\/restorecon\ \/etc\/ssh\/ssh_host_key.pub/s/^/#/' /etc/init.d/sshd
echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
service sshd restart
ssh -V