需要部署nginx的https環境,之前是yum安裝的openssl,版本比較低,如下:
[root@nginx ~]# yum install -y pcre pcre-devel openssl openssl-devel gcc [root@nginx ~]# openssl version -a OpenSSL 1.0.1e-fips 11 Feb 2013 built on: Wed Mar 22 21:43:28 UTC 2017 platform: linux-x86_64 options: bn(64,64) md2(int) rc4(16x,int) des(idx,cisc,16,int) idea(int) blowfish(idx) compiler: gcc -fPIC -DOPENSSL_PIC -DZLIB -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -DKRB5_MIT -m64 -DL_ENDIAN -DTERMIO -Wall -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -Wa,--noexecstack -DPURIFY -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM OPENSSLDIR: "/etc/pki/tls" engines: rdrand dynamic
默認yum安裝的openssl版本是1.0.1,現在需要將版本升級到1.1.0。升級的操作記錄如下:
[root@nginx ~]# wget https://www.openssl.org/source/openssl-1.1.0g.tar.gz [root@nginx ~]# tar -zvxf openssl-1.1.0g.tar.gz [root@nginx ~]# cd openssl-1.1.0g [root@nginx openssl-1.1.0g]# ./config shared zlib [root@nginx openssl-1.1.0g]# make [root@nginx openssl-1.1.0g]# make install [root@nginx openssl-1.1.0g]# mv /usr/bin/openssl /usr/bin/openssl.bak [root@nginx openssl-1.1.0g]# mv /usr/include/openssl /usr/include/openssl.bak [root@nginx openssl-1.1.0g]# find / -name openssl /etc/pki/ca-trust/extracted/openssl /data/software/nginx-1.12.2/auto/lib/openssl /data/software/openssl-1.1.0g/apps/openssl /data/software/openssl-1.1.0g/include/openssl /usr/lib64/openssl /usr/local/share/doc/openssl /usr/local/include/openssl /usr/local/bin/openssl /usr/include/openssl /usr/bin/openssl [root@nginx openssl-1.1.0g]# ln -s /usr/local/bin/openssl /usr/bin/openssl [root@nginx openssl-1.1.0g]# ln -s /usr/local/include/openssl /usr/include/openssl [root@external-lb01 ~]# find / -name "libssl*" /data/software/openssl-1.1.0g/libssl.pc /data/software/openssl-1.1.0g/libssl.so /data/software/openssl-1.1.0g/libssl.a /data/software/openssl-1.1.0g/libssl.so.1.1 /data/software/openssl-1.1.0g/util/libssl.num /usr/lib64/libssl3.so /usr/lib64/pkgconfig/libssl.pc /usr/lib64/libssl.so.1.0.1e /usr/lib64/libssl.so /usr/lib64/libssl.so.10 /usr/local/lib64/libssl.a /usr/local/lib64/pkgconfig/libssl.pc /usr/local/lib64/libssl.so /usr/local/lib64/libssl.so.1.1 [root@nginx openssl-1.1.0g]# echo "/usr/local/lib64/" >> /etc/ld.so.conf [root@nginx openssl-1.1.0g]# ldconfig [root@nginx openssl-1.1.0g]# openssl version -a OpenSSL 1.1.0g 2 Nov 2017 built on: reproducible build, date unspecified platform: linux-x86_64 compiler: gcc -DZLIB -DDSO_DLFCN -DHAVE_DLFCN_H -DNDEBUG -DOPENSSL_THREADS -DOPENSSL_NO_STATIC_ENGINE -DOPENSSL_PIC -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DRC4_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DGHASH_ASM -DECP_NISTZ256_ASM -DPADLOCK_ASM -DPOLY1305_ASM -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib64/engines-1.1\"" -Wa,--noexecstack OPENSSLDIR: "/usr/local/ssl" ENGINESDIR: "/usr/local/lib64/engines-1.1"
########## openssl升級后編譯nginx出現的問題 ###########
如上將本機的openssl升級后,由於之前編譯的nginx里沒有stream模塊,現在需要手動平滑添加stream模塊,操作如下:
檢查下,發現nginx沒有安裝stream模塊 [root@external-lb01 ~]# /data/nginx/sbin/nginx -V nginx version: nginx/1.12.2 built by gcc 4.4.7 20120313 (Red Hat 4.4.7-18) (GCC) built with OpenSSL 1.1.0g 2 Nov 2017 TLS SNI support enabled configure arguments: --prefix=/data/nginx --user=www --group=www --with-http_ssl_module --with-http_flv_module --with-http_stub_status_module --with-http_gzip_static_module --with-pcre 操作之前,一定要備份一下之前的nginx安裝目錄,防止操作失敗進行回滾! [root@external-lb01 ~]# cp -r /data/nginx /mnt/nginx.bak 之前的編譯命令是: [root@external-lb01 vhosts]# cd /data/software/nginx-1.12.2 [root@external-lb01 nginx-1.12.2]# ./configure --prefix=/data/nginx --user=www --group=www --with-http_ssl_module --with-http_flv_module --with-http_stub_status_module --with-http_gzip_static_module --with-pcre 現在需要手動添加stream,編譯命令如下: [root@external-lb01 vhosts]# cd /data/software/nginx-1.12.2 [root@external-lb01 nginx-1.12.2]# ./configure --prefix=/data/nginx --user=www --group=www --with-http_ssl_module --with-http_flv_module --with-http_stub_status_module --with-http_gzip_static_module --with-pcre --with-stream 報錯如下: ...... ./configure: error: SSL modules require the OpenSSL library. You can either do not enable the modules, or install the OpenSSL library into the system, or build the OpenSSL library statically from the source with nginx by using --with-openssl=<path> option. 原因分析:是由於openssl升級所致! [root@external-lb01 nginx-1.12.2]# openssl version -a OpenSSL 1.1.0g 2 Nov 2017 built on: reproducible build, date unspecified platform: dist compiler: cc -DNDEBUG -DOPENSSL_NO_DYNAMIC_ENGINE -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-1.1\"" OPENSSLDIR: "/usr/local/ssl" ENGINESDIR: "/usr/local/lib/engines-1.1 所以編譯命令需要改為: [root@external-lb01 nginx-1.12.2]# ./configure --prefix=/data/nginx --user=www --group=www --with-http_ssl_module --with-http_flv_module --with-http_stub_status_module --with-http_gzip_static_module --with-pcre --with-stream --with-openssl=/usr/local/ssl 然后進行make,千萬注意!!!!一定不要make install!!!否則會自動覆蓋掉之前的配置!!! [root@external-lb01 nginx-1.12.2]# make 又報錯如下: ....... make[1]: *** [/usr/local/ssl/.openssl/include/openssl/ssl.h] Error 127 make[1]: Leaving directory `/usr/local/src/nginx-1.9.9' make: *** [build] Error 2 解決辦法: [root@external-lb01 nginx-1.12.2]# cd auto/lib/openssl [root@external-lb01 openssl]# cp conf /mnt/ [root@external-lb01 openssl]# vim conf 將 CORE_INCS="$CORE_INCS $OPENSSL/.openssl/include" CORE_DEPS="$CORE_DEPS $OPENSSL/.openssl/include/openssl/ssl.h" CORE_LIBS="$CORE_LIBS $OPENSSL/.openssl/lib/libssl.a" CORE_LIBS="$CORE_LIBS $OPENSSL/.openssl/lib/libcrypto.a" CORE_LIBS="$CORE_LIBS $NGX_LIBDL" 修改為 CORE_INCS="$CORE_INCS $OPENSSL/include" CORE_DEPS="$CORE_DEPS $OPENSSL/include/openssl/ssl.h" CORE_LIBS="$CORE_LIBS $OPENSSL/lib/libssl.a" CORE_LIBS="$CORE_LIBS $OPENSSL/lib/libcrypto.a" CORE_LIBS="$CORE_LIBS $NGX_LIBDL" 接着繼續make安裝 [root@external-lb01 nginx-1.12.2]# make 又報錯說找不到下面兩個文件 /usr/local/ssl/lib/libssl.a /usr/local/ssl/lib/libcrypto.a 解決辦法: [root@external-lb01 nginx-1.12.2]# mkdir /usr/local/ssl/lib [root@external-lb01 nginx-1.12.2]# ln -s /usr/local/lib64/libssl.a /usr/local/ssl/lib/libssl.a [root@external-lb01 nginx-1.12.2]# ln -s /usr/local/lib64/libcrypto.a /usr/local/ssl/lib/libcrypto.a 然后make就可以了 [root@external-lb01 nginx-1.12.2]# make 最后進行平滑操作 [root@external-lb01 nginx-1.12.2]# cp -f /data/software/nginx-1.12.2/objs/nginx /data/nginx/sbin/nginx [root@external-lb01 nginx-1.12.2]# pkill -9 nginx [root@external-lb01 nginx-1.12.2]# /data/nginx/sbin/nginx 檢查下,發現nginx已經安裝了stream模塊了 [root@external-lb01 nginx-1.12.2]# /data/nginx/sbin/nginx -V nginx version: nginx/1.12.2 built by gcc 4.4.7 20120313 (Red Hat 4.4.7-18) (GCC) built with OpenSSL 1.1.0g 2 Nov 2017 TLS SNI support enabled configure arguments: --prefix=/data/nginx --user=www --group=www --with-http_ssl_module --with-http_flv_module --with-http_stub_status_module --with-http_gzip_static_module --with-pcre --with-stream --with-openssl=/usr/local/ssl
#########################################################
如上升級openssl版本后, 導致某些服務編譯安裝失敗的坑, 如果短時間解決不來, 最好回滾到之前的默認版本:
openssl由默認的OpenSSL 1.0.1e升級到OpenSSL 1.1.1e后, 編譯安裝keepalived, 出現下面報錯: ......... /usr/local/src/keepalived-1.3.5/keepalived/check/check_ssl.c:70: undefined reference to `OPENSSL_init_ssl' ......... 由於openssl升級后, 可能會導致一個應用編譯安裝失敗, 遇到的有nginx, keepalived等, 不得已的辦法就是將openssl回滾到之前默認的版本狀態, 操作方法如下: 查看openssl, 然后刪除升級后的openssl [root@localhost ~]# find / -name openssl [root@localhost ~]# rm -rf /usr/local/src/openssl-1.1.1 [root@localhost ~]# rm -rf /usr/local/bin/openssl [root@localhost ~]# rm -rf /usr/local/share/doc/openssl [root@localhost ~]# rm -rf /usr/local/include/openssl 然后查看下openssl版本 [root@localhost ~]# which openssl /usr/bin/openssl [root@localhost ~]# openssl version -a 報錯說/usr/local/bin/openssl 找不到這個文件 然后重啟機器 [root@localhost ~]# init 6 重啟機器后, 查看openssl版本, 如果正常查出是默認版本, 則回滾正常 [root@localhost ~]# openssl version -a 如果還是報錯"/usr/local/bin/openssl 找不到這個文件", 則需要卸載掉openssl, 重新安裝! 特別注意: 卸載openssl之前, 要確保安裝了rz, sz命令(yum install -y lrzsz), 方便后續從別的機器上傳文件 [root@localhost ~]# rpm -qa|grep openssl [root@localhost ~]# rpm -e openssl-devel-1.0.1e-57.el6.x86_64 --nodeps [root@localhost ~]# rpm -e openssl-1.0.1e-57.el6.x86_64 --nodeps openssl卸載后, 使用yum安裝會報錯 [root@localhost ~]# yum install -y openssl openssl-devel 報錯: libssl.so.10: cannot open shared object file: No such file or directory libcrypto.so.10: cannot open shared object file: No such file or directory 然后從別的正常機器(默認openssl版本的機器)上拷貝上面兩個文件(先sz到本地, 然后rz上傳到本機) 即從別的機器下載libssl.so.1.0.1e 和 libcrypto.so.1.0.1e 文件到本機的/usr/lib64下, 授權777, 並做ln軟鏈接 [root@localhost ~]# cd /usr/lib64/ [root@localhost lib64]# ll libssl.so.10 lrwxrwxrwx 1 root root 16 Dec 20 17:16 libssl.so.10 -> libssl.so.1.0.1e [root@localhost lib64]# ll libssl.so.1.0.1e -rwxr-xr-x 1 root root 443416 Mar 23 2017 libssl.so.1.0.1e [root@localhost lib64]# ll libcrypto.so.10 lrwxrwxrwx 1 root root 19 Dec 20 17:16 libcrypto.so.10 -> libcrypto.so.1.0.1e [root@localhost lib64]# ll libcrypto.so.1.0.1e -rwxr-xr-x 1 root root 1971488 Mar 23 2017 libcrypto.so.1.0.1e [root@localhost lib64]# cat /etc/ld.so.conf include ld.so.conf.d/*.conf /usr/lib64/ [root@localhost lib64]# ldconfig 然后重啟服務器 [root@localhost lib64]# init 6 [root@localhost lib64]# openssl version -a OpenSSL 1.0.1e-fips 11 Feb 2013 built on: Wed Mar 22 21:43:28 UTC 2017 platform: linux-x86_64 options: bn(64,64) md2(int) rc4(16x,int) des(idx,cisc,16,int) idea(int) blowfish(idx) compiler: gcc -fPIC -DOPENSSL_PIC -DZLIB -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -DKRB5_MIT -m64 -DL_ENDIAN -DTERMIO -Wall -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -Wa,--noexecstack -DPURIFY -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM OPENSSLDIR: "/etc/pki/tls" engines: rdrand dynamic
################################################################
curl不支持https的處理方法("Protocol https not supported or disabled in libcurl")
在使用curl訪問kubernetes-apiservers時報錯: [root@bkevin ~]# curl -s --cacert ca.pem --cert admin.pem --key admin-key.pem https://192.168.81.172:6443/metrics Protocol https not supported or disabled in libcurl 發現是因為當前系統的curl命令不支持https協議,驗證如下: [root@bkevin ~]# curl -V curl 7.64.1 (x86_64-pc-linux-gnu) libcurl/7.64.1 OpenSSL/1.0.2k zlib/1.2.8 Release-Date: 2019-03-27 Protocols: dict file ftp ftps gopher http imap imaps pop3 telnet tftp Features: AsynchDNS HTTPS-proxy IPv6 Largefile libz NTLM NTLM_WB SSL TLS-SRP UnixSockets 通過上面可以看到當前curl並不支持https協議。若用curl命令訪問https時就會報錯: Protocol https not supported or disabled in libcurl 下面是針對以上問題的處理辦法: 若需要讓curl支持https協議,需要安裝openssl並在curl中使之生效!!!! [root@bkevin ~]# openssl version -a OpenSSL 1.0.1e-fips 11 Feb 2013 built on: Wed Mar 22 21:43:28 UTC 2017 platform: linux-x86_64 options: bn(64,64) md2(int) rc4(16x,int) des(idx,cisc,16,int) idea(int) blowfish(idx) compiler: gcc -fPIC -DOPENSSL_PIC -DZLIB -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -DKRB5_MIT -m64 -DL_ENDIAN -DTERMIO -Wall -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -Wa,--noexecstack -DPURIFY -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM OPENSSLDIR: "/etc/pki/tls" engines: rdrand dynamic 下載並安裝openssl包(發現當前系統openssl是默認安裝的,不用管,直接如下編譯安裝,然后編譯安裝curl): # wget https://www.openssl.org/source/openssl-1.0.2k.tar.gz # wget https://www.openssl.org/source/openssl-fips-2.0.14.tar.gz 安裝openssl-fips: # tar xvf openssl-fips-2.0.14.tar.gz # cd openssl-fips-2.0.14&&./config&&make&&make install 安裝openssl: # tar xvf openssl-1.0.2k.tar.gz # ./config shared --prefix=/usr/local/ssl&& make && make install 更新ld # echo "/usr/local/ssl/lib" >> /etc/ld.so.conf # ldconfig -v 配置openssl庫(如果提示已經有了該路徑,就mv或unlink去掉之前的軟連接關系) # cp /usr/local/ssl/lib/libssl.so.1.0.0 /usr/lib64 # cp/usr/local/ssl/lib/libcrypto.so.1.0.0 /usr/lib64 # chmod 555 /usr/lib64/libssl.so.1.0.0 # chmod 555/usr/lib64/libcrypto.so.1.0.0 # mv /usr/lib64/libcrypto.so.10 /usr/lib64/libcrypto.so.10_bak #這個文件最好先不要動,可能會導致后續ssh啟動失敗!故次文件最好先不動! # mv /usr/lib64/libssl.so.10 /usr/lib64/libssl.so.10_bak # mv /usr/bin/openssl /usr/bin/openssl_bak # mv /usr/include/openssl /usr/include/openssl_bak # ln -s /usr/lib64/libcrypto.so.1.0.0 /usr/lib64/libcrypto.so.10 #這個文件最好先不要動,可能會導致后續ssh啟動失敗!故這個文件先不動! # ln -s /usr/lib64/libssl.so.1.0.0 /usr/lib64/libssl.so.10 # ln -s /usr/local/ssl/bin/openssl /usr/bin/openssl # ln -s/usr/local/ssl/include/openssl /usr/include/openssl 查看openssl版本 (發現openssl版本已經更新了) [root@bkevin ~]# openssl version -a OpenSSL 1.0.2k 26 Jan 2017 built on: reproducible build, date unspecified platform: linux-x86_64 options: bn(64,64) rc4(16x,int) des(idx,cisc,16,int) idea(int) blowfish(idx) compiler: gcc -I. -I.. -I../include -fPIC -DOPENSSL_PIC -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -Wa,--noexecstack -m64 -DL_ENDIAN -O3 -Wall -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DRC4_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM -DECP_NISTZ256_ASM OPENSSLDIR: "/usr/local/ssl/ssl" 重新編譯curl(找到之前編譯安裝的curl路徑,或者直接重新下載curl二進制包進行編譯安裝)。注意編譯安裝curl時一定要添加"--with-ssl",帶上openssl參數進行編譯安裝! # cd /usr/local/src/curl-7.64.1 # ./configure --with-ssl=/usr/local/ssl # make # make install 查看curl是否已經支持https協議: [root@bkevin ~]# curl -V curl 7.64.1 (x86_64-pc-linux-gnu) libcurl/7.64.1 OpenSSL/1.0.2k zlib/1.2.8 Release-Date: 2019-03-27 Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp Features: AsynchDNS HTTPS-proxy IPv6 Largefile libz NTLM NTLM_WB SSL TLS-SRP UnixSockets 由上面可知,curl現在已經可以支持https協議了,故可以使用curl訪問https了 [root@bkevin ~]# curl -s --cacert ca.pem --cert admin.pem --key admin-key.pem https://192.168.81.172:6443/metrics |head -5 # HELP APIServiceOpenAPIAggregationControllerQueue1_adds Total number of adds handled by workqueue: APIServiceOpenAPIAggregationControllerQueue1 # TYPE APIServiceOpenAPIAggregationControllerQueue1_adds counter APIServiceOpenAPIAggregationControllerQueue1_adds 18601 # HELP APIServiceOpenAPIAggregationControllerQueue1_depth Current depth of workqueue: APIServiceOpenAPIAggregationControllerQueue1 # TYPE APIServiceOpenAPIAggregationControllerQueue1_depth gauge ######################################################################################################################## ######################################################################################################################## 需要特別注意: 上面在更新openssl版本后,最好不要退出當前終端!!! 因為如上OpenSSL版本更新后,可能導致ssh遠程連接失敗問題!!! [root@bkevin ~]# ssh -p22 root@192.168.36.12 ssh_exchange_identification: read: Connection reset by peer [root@bkevin ~]# ssh -v -p22 root@192.168.36.12 OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017 debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 58: Applying options for * debug1: Connecting to 192.168.36.12 [172.20.36.12] port 22. debug1: Connection established. debug1: permanently_set_uid: 0/0 debug1: identity file /root/.ssh/id_rsa type 1 debug1: key_load_public: No such file or directory debug1: identity file /root/.ssh/id_rsa-cert type -1 debug1: key_load_public: No such file or directory debug1: identity file /root/.ssh/id_dsa type -1 debug1: key_load_public: No such file or directory debug1: identity file /root/.ssh/id_dsa-cert type -1 debug1: key_load_public: No such file or directory debug1: identity file /root/.ssh/id_ecdsa type -1 debug1: key_load_public: No such file or directory debug1: identity file /root/.ssh/id_ecdsa-cert type -1 debug1: key_load_public: No such file or directory debug1: identity file /root/.ssh/id_ed25519 type -1 debug1: key_load_public: No such file or directory debug1: identity file /root/.ssh/id_ed25519-cert type -1 debug1: Enabling compatibility mode for protocol 2.0 debug1: Local version string SSH-2.0-OpenSSH_7.4 ssh_exchange_identification: read: Connection reset by peer 解決辦法:在ssh在服務端更改配置文件修改: [root@bkevin ~]# vi /etc/hosts.allow ######################### sshd: ALL ##允許所有ip主機均能連接本機 [root@bkevin ~]# /etc/init.d/sshd restart Stopping sshd: [FAILED] Starting sshd: /usr/sbin/sshd: /usr/lib64/libcrypto.so.10: no version information available (required by /usr/sbin/sshd) /usr/sbin/sshd: /usr/lib64/libcrypto.so.10: no version information available (required by /usr/sbin/sshd) /usr/sbin/sshd: /usr/lib64/libcrypto.so.10: no version information available (required by /usr/sbin/sshd) OpenSSL version mismatch. Built against 1000105f, you have 100020bf 解決辦法: [root@bkevin ~]# unlink /usr/lib64/libcrypto.so.10 [root@bkevin ~]# cp /usr/lib64/libcrypto.so.10_bak /usr/lib64/libcrypto.so.10 [root@bkevin ~]# /etc/init.d/sshd restart Stopping sshd: [FAILED] Starting sshd: [ OK ] [root@bz4paas02zk1001 ~]# /etc/init.d/sshd restart Stopping sshd: [ OK ] Starting sshd: [ OK ] 再次嘗試遠程ssh連接,就正常了! [root@bkevin ~]# ssh -p22 root@192.168.36.12 Authorized only. All activity will be monitored and reported Last login: Mon Mar 2 09:06:17 2020 from 172.20.20.65 [root@02zk1001 ~]#