Ubuntu 16.04.4 LTS
安裝依賴包保平安
apt-get install root-system-bin autoconf automake make build-essential libpam0g-dev gcc libpcre3 libpcre3-dev zlib1g-dev libssl-dev libbz2-dev
下載的壓縮包放在opt目錄
cd /opt/
wget https://www.openssl.org/source/openssl-1.0.2o.tar.gz
wget http://ftp.jaist.ac.jp/pub/OpenBSD/OpenSSH/portable/openssh-7.7p1.tar.gz
解壓
tar zxf openssl-1.0.2o.tar.gz
tar zxf openssh-7.7p1.tar.gz
進(jìn)入openssl源碼目錄
cd openssl-1.0.2o/
./config shared zlib???? #加上shared參數(shù)是生成共享庫文件,不然后邊源碼安裝openssl的時候會提示找不到文件
make -j $(cat /proc/cpuinfo| grep "processor"|wc -l) && make install
mv /usr/bin/openssl /root/??? #移動原來的openssl執(zhí)行文件到用戶目錄,這個可以隨意放
ln -s /usr/local/ssl/bin/openssl /usr/bin/openssl???? #新版的openssl做個軟鏈
openssl version???? #如果版本顯示為新版則大功告成
刪除/lib/x86_64-linux-gnu路徑下舊版的libssl.so.1.0.0和libcrypto.so.1.0.0文件
rm -f /lib/x86_64-linux-gnu/libssl.so.1.0.0 && rm -f?/lib/x86_64-linux-gnu/libcrypto.so.1.0.0
軟鏈個新版的
ln -s /usr/local/ssl/lib/libssl.so.1.0.0 /lib/x86_64-linux-gnu/libssl.so.1.0.0 && ln -s /usr/local/ssl/lib/libcrypto.so.1.0.0 /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
引擎目錄同理
mv /usr/lib/x86_64-linux-gnu/openssl-1.0.0/engines/ /usr/lib/x86_64-linux-gnu/openssl-1.0.0/engines.old/
?ln -s /usr/local/ssl/lib/engines /usr/lib/x86_64-linux-gnu/openssl-1.0.0/engines
好,繼續(xù)安裝新版ssh
cd /opt/openssh-7.7p1/
./configure --prefix=/usr --sysconfdir=/etc/ssh --with-md5-passwords --with-pam --with-ssl-dir=/usr/local/ssl --with-zlib=/usr/local/include
make -j $(cat /proc/cpuinfo| grep "processor"|wc -l) && make install
ssh -V??? #如版本顯示為新版本則大功告成
ubuntu 16.04的升級完畢
CentOS 7.5.1804
安裝依賴包保平安
yum install pam-devel tcp_wrappers-devel make pam autoconf automake gcc c++ zlib-devel.x86_64 openssl-devel.x86_64
cd /opt/
wget https://www.openssl.org/source/openssl-1.0.2o.tar.gz
wget http://ftp.jaist.ac.jp/pub/OpenBSD/OpenSSH/portable/openssh-7.7p1.tar.gz
wget https://www.openssl.org/source/openssl-fips-2.0.16.tar.gz
tar zxf openssl-1.0.2o.tar.gz
tar zxf openssh-7.7p1.tar.gz
tar zxf openssl-fips-2.0.16.tar.gz
源碼安裝openssl-fips,據(jù)說這個可以提高openssl的性能,ubuntu上也可以用,但是這里我只在CentOS上安裝。
cd openssl-fips-2.0.16
./config shared zlib??? #shared參數(shù)生成動態(tài)庫
make -j $(cat /proc/cpuinfo| grep "processor"|wc -l) && make install
源碼安裝openssl,我這里直接指定到系統(tǒng)原openssl的安裝目錄,直接覆蓋。
cd openssl-1.0.2o
./config fips shared --prefix=/usr threads zlib
make depend
make -j $(cat /proc/cpuinfo| grep "processor"|wc -l) && make install
源碼安裝openssh,我這里直接指定到系統(tǒng)原openssh的安裝目錄,直接覆蓋。
cd openssh-7.7p1
./configure --prefix=/usr --sysconfdir=/etc/ssh --with-md5-passwords --with-pam --with-ssl-dir=../openssl-1.0.2o --with-zlib=/usr/local/include
make -j $(cat /proc/cpuinfo| grep "processor"|wc -l) && make install
ssh -V??? #如版本顯示為新版本則大功告成
OK,就這么簡單。