openssh升級到7.2版本

環境:RHEL 6.1_x86_64node

準備相關的包
openssh下載地址:http://mirror.internode.on.net/pub/OpenBSD/OpenSSH/portable/
openssl相關包下載:http://www.openssl.org/source/
pam相關包下載:http://pkgs.org/centos-6/centos-x86_64/
zlib包下載: http://zlib.net/centos

一、升級zlib
tar zxvf zlib-1.2.8.tar.gz
cd zlib-1.2.8
./configure
make && make install服務器

二、更新pam的rpm包。否則configure openssh的時候會報錯
yum install pam-1.1.1-13.el6.x86_64.rpm pam-devel-1.1.1-13.el6.x86_64.rpmssh


注意:如下安裝時,請務必再開一個SSH窗口鏈接所須要升級的服務器,避免ssh升級失敗後,沒法鏈接服務器。.net


三、編譯安裝openssl
tar zxvf openssl-1.0.2h.tar.gz
cd openssl-1.0.2h
./config --prefix=/usr/ --openssldir=/usr/ shared
make && make installrest

====如下6行不操做,有些文章說明要作這些操做,可是我升級的時候沒有這個。
mv /usr/bin/openssl /usr/bin/openssl.OFF
mv /usr/include/openssl /usr/include/openssl.OFFssl

ln -s /usr/local/ssl/bin/openssl /usr/bin/openssl
ln -s /usr/local/ssl/include/openssl /usr/include/opensslopenssl

echo "/usr/local/ssl/lib" >> /etc/ld.so.conf
#ldconfig -vit

 

查看openssl版本。openssl version顯示OpenSSL 1.0.2h 3 May 2016。io

 

四、編譯安裝openssh
tar zxvf openssh-7.2p2.tar.gz
cd openssh-7.2p2
./configure --with-zlib --with-ssl-dir --with-pam --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc/ssh

若是提示configure: error: PAM headers not found,多是第2步沒執行,須要安裝pam-devel。

make && make install

完成後查看ssh版本。ssh -V查看

[root@localhost software]# ssh -V
OpenSSH_7.2p2, OpenSSL 1.0.2h 3 May 2016

五、重啓ssh服務。ssh -Vservice sshd restart

相關文章
相關標籤/搜索