1、適用RadHat 6.5 在離線環境下升級Openssh至7.6P1,升級過程當中不影響其餘業務正常使用。node
下載安裝包並上傳到用戶目錄。
具體涉及到的包有:
openssh-7.6p1.tar.gz
openssl-1.0.2r.tar.gz
(OpenSSL 的官方網站:http://www.openssl.org)
openssl-fips-2.0.16.tar.gz
(OpenSSL 的官方網站:http://www.openssl.org)
pam-devel-1.1.1-24.el6.x86_64.rpm
(pam-devel官方下載網站: https://pkgs.org/download/pam-devel)
zlib-1.2.11.tar.gz
(Zlib 官方網站:http://www.zlib.net/)
ssh
#ssh –V
[root@demo ~]# tar xf zlib-1.2.11.tar.gz
進入解壓後的目錄ide
[root@demo ~]#cd zlib-1.2.11
[root@demo zlib-1.2.11]#./configure [root@demo zlib-1.2.11]#make test [root@demo zlib-1.2.11]#make install
[root@demo zlib-1.2.11]#make clean [root@demo zlib-1.2.11]#./configure --shared [root@demo zlib-1.2.11]#make test [root@demo zlib-1.2.11]#make install [root@demo zlib-1.2.11]#cp zutil.h /usr/local/include [root@demo zlib-1.2.11]#cp zutil.c /usr/local/include
至此,Zlib編譯安裝完成。網站
[root@demo zlib-1.2.11]# rpm -qa |grep pam-devel pam-devel-1.1.1-17.el6.x86_64
[root@demo zlib-1.2.11]# rpm -e --nodeps pam-devel-1.1.1-17.el6.x86_64
從當前目錄切換到存放pam-devel最新版本的目錄下,執行命令:.net
[root@demo ~]# rpm -ivh pam-devel-1.1.1-24.el6.x86_64.rpm --force --nodeps
這樣就安裝好最新版本了。rest
[root@demo ~]# tar xf openssl-fips-2.0.16.tar.gz [root@demo ~]# cd openssl-fips-2.0.16 [root@demo openssl-fips-2.0.16]# ./config [root@demo openssl-fips-2.0.16]# make [root@demo openssl-fips-2.0.16]# make install
默認安裝到/usr/local/ssl/fips-2.0 安裝成功:
code
切換至存放 openssl-1.0.2r.tar.gz文件的目錄下,執行命令:server
[root@demo ~]#tar xf openssl-1.0.2r.tar.gz [root@demo ~]#cd openssl-1.0.2r [root@demo openssl-1.0.2r]#./config --shared zlib #必定要加上shared 參數,要不在安裝openssh的時候就沒法找到 [root@demo openssl-1.0.2r]#make [root@demo openssl-1.0.2r]#make install
[root@demo openssl-1.0.2r]#mv /usr/bin/openssl /usr/bin/openssl.bak [root@demo openssl-1.0.2r]#mv /usr/include/openssl /usr/include/openssl.bak
注意,由於源碼安裝默認安裝的位置是 /usr/local/ssl 須要將建立軟連接到系統位置,
若/usr/include 下沒有相關的openssl 能夠忽略blog
[root@demo openssl-1.0.2r]#ln -s /usr/local/ssl/bin/openssl /usr/bin/openssl [root@demo openssl-1.0.2r]#ln -s /usr/local/ssl/include/openssl /usr/include/openssl
[root@demo openssl-1.0.2r]#echo 「/usr/local/ssl/lib」 > /etc/ld.so.conf.d/openssl.conf
[root@demo openssl-1.0.2r]#ldconfig
openssl version –a
[root@demo openssl-1.0.2r]# openssl version
[root@demo openssl-1.0.2r]# mv /etc/ssh /etc/ssh.old
[root@demo openssl-1.0.2r]#rpm –qa |grep openssh
[root@demo openssl-1.0.2r]# rpm -e --nodeps openssh-5.3p1-94.el6.x86_64 [root@demo openssl-1.0.2r]#rpm -e --nodeps openssh-askpass-5.3p1-94.el6.x86_64 [root@demo openssl-1.0.2r]#rpm -e --nodeps openssh-server-5.3p1-94.el6.x86_64 [root@demo openssl-1.0.2r]#rpm -e --nodeps openssh-clients-5.3p1-94.el6.x86_64 [root@demo openssl-1.0.2r]# rpm -qa | grep openssh
[root@demo ~]# tar xf openssh-7.6p1.tar.gz [root@demo ~]# cd openssh-7.6p1
** 編譯(同時兼容ssh1協議)ip
[root@demo openssh-7.6p1]# ./configure --prefix=/usr --sysconfdir=/etc/ssh --with-ssl-dir=/usr/local/ssl/lib --with-md5-passwords --with-pam --with-zlib --with-ssh1 [root@demo openssh-7.6p1]#make [root@demo openssh-7.6p1]#make install
[root@demo redhat]# cp contrib/redhat/sshd.init /etc/init.d/sshd [root@demo redhat]# chmod +x /etc/init.d/sshd [root@demo redhat]# chkconfig --add sshd
[root@demo ~]#service sshd start