#以下是根据我的实际环境所写,请根据自己实际环境操作。

#OpenSSH_5.3p1, OpenSSL 1.0.1e-fips 11 Feb 2013

#GNU bash, version 4.1.2(2)-release (x86_64-redhat-linux-gnu)

#!/bin/bash

cd /tmp/openssl/

cp /usr/lib64/libssl.so.10 /tmp

cp /usr/lib64/libcrypto.so.10 /tmp

service sshd stop

rpm -e openssl openssh openssh-askpass openssh-clients openssh-server --nodeps

cp /tmp/libssl.so.10 /usr/lib64

cp /tmp/libcrypto.so.10 /usr/lib64

rpm -ivh openssl-1.0.1e-57.el6.x86_64.rpm

rpm -ivh openssh-5.3p1-122.el6.x86_64.rpm

rpm -ivh openssh-askpass-5.3p1-122.el6.x86_64.rpm

rpm -ivh openssh-server-5.3p1-122.el6.x86_64.rpm

rpm -ivh openssh-clients-5.3p1-122.el6.x86_64.rpm

rpm -e bash --nodeps

rpm -ivh bash-4.1.2-48.el6.x86_64.rpm

sed -i 's;#Port 22;Port 65022;g' /etc/ssh/sshd_config

/etc/init.d/sshd restart

ssh -V

bash -version |grep release

rpm -qa|grep openssh

rm -f /tmp/zw.sh


----------------------------

源码opssl升级:

找到安装目录的路径:

[root@localhost renyh]# find / -name ssh

/etc/ssh

/usr/local/bin/ssh

/tmp/openssh-7.4p1/ssh


进入安装目录卸载:

[root@localhost renyh]# cd /tmp/openssh-7.4p1

[root@localhost openssh-7.4p1]# make uninstall


挂载内部网络镜像,搭建本地yum源:

[root@localhost openssh-7.4p1]# mkdir /zhongw

[root@localhost openssh-7.4p1]# mount 172.16.0.218:/vx/Citrix_ISO_NFS/ /zhongw/

[root@localhost openssh-7.4p1]# mount -o loop /zhongw/CentOS-6.9-x86_64-bin-DVD1.iso /mnt/

[root@localhost openssh-7.4p1]# cat /etc/yum.repos.d/rhel-source.repo 

[base]

Baseurl=file:///mnt/

Enabled=1

Gpgcheck=0


安装升级ssh:

[root@localhost openssh-7.4p1]#yum -y install openssl

[root@localhost openssh-7.4p1]# yum -y install openssh-clients openssh openssh-server openssh-askpass

[root@localhost openssh-7.4p1]# ssh -V

OpenSSH_5.3p1, OpenSSL 1.0.1e-fips 11 Feb 2013

记得检查端口


ln -s  /usr/bin/ssh  /usr/local/bin/ssh 

将前面目录指定到后面的目录(软连接)