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

相关文章
相关标签/搜索