CentOS7.1 升级openssh到openssh-7.4p1

时间:2022-11-28 00:28:30


准备软件包:

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


本文出自 “挥舞狂草,不屈姿态狂啸” 博客,请务必保留此出处http://jidong.blog.51cto.com/6212447/1892333