-------------------------------------------------html
1、下載地址centos
2、系統版本及建議bash
3、安裝opensslssh
4、安裝opensshtcp
5、驗證ide
-------------------------------------------------工具
1、下載地址阿里雲
openssl下載地址:spa
https://www.openssl.org/source/
openssh下載地址:操作系統
https://openbsd.hk/pub/OpenBSD/OpenSSH/portable/
2、系統版本及建議
操做系統版本:centos 6.3 64位
openssh和openssl版本:
# ssh -V OpenSSH_5.3p1, OpenSSL 1.0.0-fips 29 Mar 2010
升級前建議打開telnet服務,使用telnet進行登陸操做,避免沒法遠程鏈接
3、安裝openssl
1.安裝相關編譯工具
# yum install gcc make perl pam pam-devel zlib zlib-devel openssl-devel
2.編譯安裝openssl
# cd openssl-1.0.2l # ./config --prefix=/usr/local/ssl shared zlib # make # make install
3.備份歷史的openssl文件
# mv /usr/bin/openssl /usr/bin/openssl.bak # mv /usr/include/openssl /usr/include/openssl.bak
4.設置軟鏈接,使用新的openssl版本,openssl安裝在/usr/local/ssl目錄
# ln -s /usr/local/ssl/bin/openssl /usr/bin/openssl # ln -s /usr/local/ssl/include/openssl /usr/include/openssl
5.修改系統自帶的openssl庫文件,軟連接到升級後的libssl.so
# ln -s /usr/local/ssl/lib/libssl.so.1.0.0 /usr/local/lib64/libssl.so
6.更新動態連接庫數據
# echo "/usr/local/ssl/lib" >> /etc/ld.so.conf # ldconfig -v
7.查看新安裝的openssl版本
# openssl version OpenSSL 1.0.2l 25 May 2017
4、安裝openssh
1.中止ssh服務
# service sshd stop
2.卸載openssh-server,並備份歷史配置文件
# rpm -qa |grep openss openssl-1.0.0-27.el6.x86_64 openssh-5.3p1-84.1.el6.x86_64 openssh-server-5.3p1-84.1.el6.x86_64 # rpm -e openssh-server # mv /etc/ssh /etc/ssh.bak
3.編譯並安裝openssh
# cd openssh-7.5p1 # ./configure --prefix=/usr --sysconfdir=/etc/ssh --with-pam --with-zlib --with-ssl-dir=/usr/local/ssl --with-md5-passwords # make # make install
4.查看新安裝的openssl版本
# ssh -V OpenSSH_7.5p1, OpenSSL 1.0.2l 25 May 2017
5.配置ssh
# cp openssh-7.5p1/contrib/redhat/sshd.init /etc/init.d/sshd //加入系統服務 # chkconfig --add sshd # vi /etc/ssh/sshd_config //容許root遠程登陸 PermitRootLogin yes //將prohibit-password替換爲yes # service sshd start # netstat -tupln |grep 22 tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 36385/sshd tcp 0 0 :::22 :::* LISTEN 36385/sshd
5、驗證
阿里雲開年HI購季,爆款雲產品低至5折!
送您一個最高1000元的阿里雲大禮包,快來領取吧~
https://promotion.aliyun.com/ntms/yunparter/invite.html?userCode=pdhbtt9j