需要部署nginx的https环境,之前是yum安装的openssl,版本比较低,如下:

  1. [root@nginx ~]# yum install -y pcre pcre-devel openssl openssl-devel gcc
  2.  
  3. [root@nginx ~]# openssl version -a
  4. OpenSSL 1.0.1e-fips 11 Feb 2013
  5. built on: Wed Mar 22 21:43:28 UTC 2017
  6. platform: linux-x86_64
  7. options: bn(64,64) md2(int) rc4(16x,int) des(idx,cisc,16,int) idea(int) blowfish(idx)
  8. 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
  9. OPENSSLDIR: "/etc/pki/tls"
  10. engines: rdrand dynamic

默认yum安装的openssl版本是1.0.1,现在需要将版本升级到1.1.0。升级的操作记录如下:

  1. [root@nginx ~]# wget https://www.openssl.org/source/openssl-1.1.0g.tar.gz
  2. [root@nginx ~]# tar -zvxf openssl-1.1.0g.tar.gz
  3. [root@nginx ~]# cd openssl-1.1.0g
  4. [root@nginx openssl-1.1.0g]# ./config shared zlib
  5. [root@nginx openssl-1.1.0g]# make
  6. [root@nginx openssl-1.1.0g]# make install
  7.  
  8. [root@nginx openssl-1.1.0g]# mv /usr/bin/openssl /usr/bin/openssl.bak
  9. [root@nginx openssl-1.1.0g]# mv /usr/include/openssl /usr/include/openssl.bak
  10.  
  11. [root@nginx openssl-1.1.0g]# find / -name openssl
  12. /etc/pki/ca-trust/extracted/openssl
  13. /data/software/nginx-1.12.2/auto/lib/openssl
  14. /data/software/openssl-1.1.0g/apps/openssl
  15. /data/software/openssl-1.1.0g/include/openssl
  16. /usr/lib64/openssl
  17. /usr/local/share/doc/openssl
  18. /usr/local/include/openssl
  19. /usr/local/bin/openssl
  20. /usr/include/openssl
  21. /usr/bin/openssl
  22.  
  23. [root@nginx openssl-1.1.0g]# ln -s /usr/local/bin/openssl /usr/bin/openssl
  24. [root@nginx openssl-1.1.0g]# ln -s /usr/local/include/openssl /usr/include/openssl
  25.  
  26. [root@external-lb01 ~]# find / -name "libssl*"
  27. /data/software/openssl-1.1.0g/libssl.pc
  28. /data/software/openssl-1.1.0g/libssl.so
  29. /data/software/openssl-1.1.0g/libssl.a
  30. /data/software/openssl-1.1.0g/libssl.so.1.1
  31. /data/software/openssl-1.1.0g/util/libssl.num
  32. /usr/lib64/libssl3.so
  33. /usr/lib64/pkgconfig/libssl.pc
  34. /usr/lib64/libssl.so.1.0.1e
  35. /usr/lib64/libssl.so
  36. /usr/lib64/libssl.so.10
  37. /usr/local/lib64/libssl.a
  38. /usr/local/lib64/pkgconfig/libssl.pc
  39. /usr/local/lib64/libssl.so
  40. /usr/local/lib64/libssl.so.1.1
  41.  
  42. [root@nginx openssl-1.1.0g]# echo "/usr/local/lib64/" >> /etc/ld.so.conf
  43. [root@nginx openssl-1.1.0g]# ldconfig
  44.  
  45. [root@nginx openssl-1.1.0g]# openssl version -a
  46. OpenSSL 1.1.0g 2 Nov 2017
  47. built on: reproducible build, date unspecified
  48. platform: linux-x86_64
  49. 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
  50. OPENSSLDIR: "/usr/local/ssl"
  51. ENGINESDIR: "/usr/local/lib64/engines-1.1"

##########  openssl升级后编译nginx出现的问题  ###########
如上将本机的openssl升级后,由于之前编译的nginx里没有stream模块,现在需要手动平滑添加stream模块,操作如下:

  1. 检查下,发现nginx没有安装stream模块
  2. [root@external-lb01 ~]# /data/nginx/sbin/nginx -V
  3. nginx version: nginx/1.12.2
  4. built by gcc 4.4.7 20120313 (Red Hat 4.4.7-18) (GCC)
  5. built with OpenSSL 1.1.0g 2 Nov 2017
  6. TLS SNI support enabled
  7. 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
  8.  
  9. 操作之前,一定要备份一下之前的nginx安装目录,防止操作失败进行回滚!
  10. [root@external-lb01 ~]# cp -r /data/nginx /mnt/nginx.bak
  11.  
  12. 之前的编译命令是:
  13. [root@external-lb01 vhosts]# cd /data/software/nginx-1.12.2
  14. [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
  15.  
  16. 现在需要手动添加stream,编译命令如下:
  17. [root@external-lb01 vhosts]# cd /data/software/nginx-1.12.2
  18. [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
  19.  
  20. 报错如下:
  21. ......
  22. ./configure: error: SSL modules require the OpenSSL library.
  23. You can either do not enable the modules, or install the OpenSSL library
  24. into the system, or build the OpenSSL library statically from the source
  25. with nginx by using --with-openssl=<path> option.
  26.  
  27. 原因分析:是由于openssl升级所致!
  28. [root@external-lb01 nginx-1.12.2]# openssl version -a
  29. OpenSSL 1.1.0g 2 Nov 2017
  30. built on: reproducible build, date unspecified
  31. platform: dist
  32. compiler: cc -DNDEBUG -DOPENSSL_NO_DYNAMIC_ENGINE -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-1.1\""
  33. OPENSSLDIR: "/usr/local/ssl"
  34. ENGINESDIR: "/usr/local/lib/engines-1.1
  35.  
  36. 所以编译命令需要改为:
  37. [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
  38.  
  39. 然后进行make,千万注意!!!!一定不要make install!!!否则会自动覆盖掉之前的配置!!!
  40. [root@external-lb01 nginx-1.12.2]# make
  41. 又报错如下:
  42. .......
  43. make[1]: *** [/usr/local/ssl/.openssl/include/openssl/ssl.h] Error 127
  44. make[1]: Leaving directory `/usr/local/src/nginx-1.9.9'
  45. make: *** [build] Error 2
  46.  
  47. 解决办法:
  48. [root@external-lb01 nginx-1.12.2]# cd auto/lib/openssl
  49. [root@external-lb01 openssl]# cp conf /mnt/
  50. [root@external-lb01 openssl]# vim conf

  51. CORE_INCS="$CORE_INCS $OPENSSL/.openssl/include"
  52. CORE_DEPS="$CORE_DEPS $OPENSSL/.openssl/include/openssl/ssl.h"
  53. CORE_LIBS="$CORE_LIBS $OPENSSL/.openssl/lib/libssl.a"
  54. CORE_LIBS="$CORE_LIBS $OPENSSL/.openssl/lib/libcrypto.a"
  55. CORE_LIBS="$CORE_LIBS $NGX_LIBDL"
  56. 修改为
  57. CORE_INCS="$CORE_INCS $OPENSSL/include"
  58. CORE_DEPS="$CORE_DEPS $OPENSSL/include/openssl/ssl.h"
  59. CORE_LIBS="$CORE_LIBS $OPENSSL/lib/libssl.a"
  60. CORE_LIBS="$CORE_LIBS $OPENSSL/lib/libcrypto.a"
  61. CORE_LIBS="$CORE_LIBS $NGX_LIBDL"
  62.  
  63. 接着继续make安装
  64. [root@external-lb01 nginx-1.12.2]# make
  65. 又报错说找不到下面两个文件
  66. /usr/local/ssl/lib/libssl.a
  67. /usr/local/ssl/lib/libcrypto.a
  68.  
  69. 解决办法:
  70. [root@external-lb01 nginx-1.12.2]# mkdir /usr/local/ssl/lib
  71. [root@external-lb01 nginx-1.12.2]# ln -s /usr/local/lib64/libssl.a /usr/local/ssl/lib/libssl.a
  72. [root@external-lb01 nginx-1.12.2]# ln -s /usr/local/lib64/libcrypto.a /usr/local/ssl/lib/libcrypto.a
  73.  
  74. 然后make就可以了
  75. [root@external-lb01 nginx-1.12.2]# make
  76.  
  77. 最后进行平滑操作
  78. [root@external-lb01 nginx-1.12.2]# cp -f /data/software/nginx-1.12.2/objs/nginx /data/nginx/sbin/nginx
  79. [root@external-lb01 nginx-1.12.2]# pkill -9 nginx
  80. [root@external-lb01 nginx-1.12.2]# /data/nginx/sbin/nginx
  81.  
  82. 检查下,发现nginx已经安装了stream模块了
  83. [root@external-lb01 nginx-1.12.2]# /data/nginx/sbin/nginx -V
  84. nginx version: nginx/1.12.2
  85. built by gcc 4.4.7 20120313 (Red Hat 4.4.7-18) (GCC)
  86. built with OpenSSL 1.1.0g 2 Nov 2017
  87. TLS SNI support enabled
  88. 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版本后, 导致某些服务编译安装失败的坑, 如果短时间解决不来, 最好回滚到之前的默认版本:

  1. openssl由默认的OpenSSL 1.0.1e升级到OpenSSL 1.1.1e后, 编译安装keepalived, 出现下面报错:
  2. .........
  3. /usr/local/src/keepalived-1.3.5/keepalived/check/check_ssl.c:70: undefined reference to `OPENSSL_init_ssl'
  4. .........
  5.  
  6. 由于openssl升级后, 可能会导致一个应用编译安装失败, 遇到的有nginx, keepalived等, 不得已的办法就是将openssl回滚到之前默认的版本状态, 操作方法如下:
  7. 查看openssl, 然后删除升级后的openssl
  8. [root@localhost ~]# find / -name openssl
  9. [root@localhost ~]# rm -rf /usr/local/src/openssl-1.1.1
  10. [root@localhost ~]# rm -rf /usr/local/bin/openssl
  11. [root@localhost ~]# rm -rf /usr/local/share/doc/openssl
  12. [root@localhost ~]# rm -rf /usr/local/include/openssl
  13.  
  14. 然后查看下openssl版本
  15. [root@localhost ~]# which openssl
  16. /usr/bin/openssl
  17. [root@localhost ~]# openssl version -a
  18. 报错说/usr/local/bin/openssl 找不到这个文件
  19.  
  20. 然后重启机器
  21. [root@localhost ~]# init 6
  22.  
  23. 重启机器后, 查看openssl版本, 如果正常查出是默认版本, 则回滚正常
  24. [root@localhost ~]# openssl version -a
  25.  
  26. 如果还是报错"/usr/local/bin/openssl 找不到这个文件", 则需要卸载掉openssl, 重新安装!
  27. 特别注意: 卸载openssl之前, 要确保安装了rz, sz命令(yum install -y lrzsz), 方便后续从别的机器上传文件
  28. [root@localhost ~]# rpm -qa|grep openssl
  29. [root@localhost ~]# rpm -e openssl-devel-1.0.1e-57.el6.x86_64 --nodeps
  30. [root@localhost ~]# rpm -e openssl-1.0.1e-57.el6.x86_64 --nodeps
  31.  
  32. openssl卸载后, 使用yum安装会报错
  33. [root@localhost ~]# yum install -y openssl openssl-devel
  34. 报错:
  35. libssl.so.10: cannot open shared object file: No such file or directory
  36. libcrypto.so.10: cannot open shared object file: No such file or directory
  37.  
  38. 然后从别的正常机器(默认openssl版本的机器)上拷贝上面两个文件(先sz到本地, 然后rz上传到本机)
  39.  
  40. 即从别的机器下载libssl.so.1.0.1e 和 libcrypto.so.1.0.1e 文件到本机的/usr/lib64下, 授权777, 并做ln软链接
  41. [root@localhost ~]# cd /usr/lib64/
  42. [root@localhost lib64]# ll libssl.so.10
  43. lrwxrwxrwx 1 root root 16 Dec 20 17:16 libssl.so.10 -> libssl.so.1.0.1e
  44.  
  45. [root@localhost lib64]# ll libssl.so.1.0.1e
  46. -rwxr-xr-x 1 root root 443416 Mar 23 2017 libssl.so.1.0.1e
  47.  
  48. [root@localhost lib64]# ll libcrypto.so.10
  49. lrwxrwxrwx 1 root root 19 Dec 20 17:16 libcrypto.so.10 -> libcrypto.so.1.0.1e
  50.  
  51. [root@localhost lib64]# ll libcrypto.so.1.0.1e
  52. -rwxr-xr-x 1 root root 1971488 Mar 23 2017 libcrypto.so.1.0.1e
  53.  
  54. [root@localhost lib64]# cat /etc/ld.so.conf
  55. include ld.so.conf.d/*.conf
  56. /usr/lib64/
  57.  
  58. [root@localhost lib64]# ldconfig
  59.  
  60. 然后重启服务器
  61. [root@localhost lib64]# init 6
  62.  
  63. [root@localhost lib64]# openssl version -a
  64. OpenSSL 1.0.1e-fips 11 Feb 2013
  65. built on: Wed Mar 22 21:43:28 UTC 2017
  66. platform: linux-x86_64
  67. options: bn(64,64) md2(int) rc4(16x,int) des(idx,cisc,16,int) idea(int) blowfish(idx)
  68. 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
  69. OPENSSLDIR: "/etc/pki/tls"
  70. engines: rdrand dynamic

################################################################
curl不支持https的处理方法("Protocol https not supported or disabled in libcurl")

  1. 在使用curl访问kubernetes-apiservers时报错:
  2. [root@bkevin ~]# curl -s --cacert ca.pem --cert admin.pem --key admin-key.pem https://192.168.81.172:6443/metrics
  3. Protocol https not supported or disabled in libcurl
  4.  
  5. 发现是因为当前系统的curl命令不支持https协议,验证如下:
  6. [root@bkevin ~]# curl -V
  7. curl 7.64.1 (x86_64-pc-linux-gnu) libcurl/7.64.1 OpenSSL/1.0.2k zlib/1.2.8
  8. Release-Date: 2019-03-27
  9. Protocols: dict file ftp ftps gopher http imap imaps pop3 telnet tftp
  10. Features: AsynchDNS HTTPS-proxy IPv6 Largefile libz NTLM NTLM_WB SSL TLS-SRP UnixSockets
  11.  
  12. 通过上面可以看到当前curl并不支持https协议。若用curl命令访问https时就会报错:
  13. Protocol https not supported or disabled in libcurl
  14.  
  15. 下面是针对以上问题的处理办法:
  16. 若需要让curl支持https协议,需要安装openssl并在curl中使之生效!!!!
  17.  
  18. [root@bkevin ~]# openssl version -a
  19. OpenSSL 1.0.1e-fips 11 Feb 2013
  20. built on: Wed Mar 22 21:43:28 UTC 2017
  21. platform: linux-x86_64
  22. options: bn(64,64) md2(int) rc4(16x,int) des(idx,cisc,16,int) idea(int) blowfish(idx)
  23. 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
  24. OPENSSLDIR: "/etc/pki/tls"
  25. engines: rdrand dynamic
  26.  
  27. 下载并安装openssl包(发现当前系统openssl是默认安装的,不用管,直接如下编译安装,然后编译安装curl):
  28. # wget https://www.openssl.org/source/openssl-1.0.2k.tar.gz
  29. # wget https://www.openssl.org/source/openssl-fips-2.0.14.tar.gz
  30.  
  31. 安装openssl-fips
  32. # tar xvf openssl-fips-2.0.14.tar.gz
  33. # cd openssl-fips-2.0.14&&./config&&make&&make install
  34.  
  35. 安装openssl
  36. # tar xvf openssl-1.0.2k.tar.gz
  37. # ./config shared --prefix=/usr/local/ssl&& make && make install
  38.  
  39. 更新ld
  40. # echo "/usr/local/ssl/lib" >> /etc/ld.so.conf
  41. # ldconfig -v
  42.  
  43. 配置openssl库(如果提示已经有了该路径,就mvunlink去掉之前的软连接关系)
  44. # cp /usr/local/ssl/lib/libssl.so.1.0.0 /usr/lib64
  45. # cp/usr/local/ssl/lib/libcrypto.so.1.0.0 /usr/lib64
  46. # chmod 555 /usr/lib64/libssl.so.1.0.0
  47. # chmod 555/usr/lib64/libcrypto.so.1.0.0
  48.  
  49. # mv /usr/lib64/libcrypto.so.10 /usr/lib64/libcrypto.so.10_bak #这个文件最好先不要动,可能会导致后续ssh启动失败!故次文件最好先不动!
  50. # mv /usr/lib64/libssl.so.10 /usr/lib64/libssl.so.10_bak
  51. # mv /usr/bin/openssl /usr/bin/openssl_bak
  52. # mv /usr/include/openssl /usr/include/openssl_bak
  53.  
  54. # ln -s /usr/lib64/libcrypto.so.1.0.0 /usr/lib64/libcrypto.so.10 #这个文件最好先不要动,可能会导致后续ssh启动失败!故这个文件先不动!
  55. # ln -s /usr/lib64/libssl.so.1.0.0 /usr/lib64/libssl.so.10
  56. # ln -s /usr/local/ssl/bin/openssl /usr/bin/openssl
  57. # ln -s/usr/local/ssl/include/openssl /usr/include/openssl
  58.  
  59. 查看openssl版本 (发现openssl版本已经更新了)
  60. [root@bkevin ~]# openssl version -a
  61. OpenSSL 1.0.2k 26 Jan 2017
  62. built on: reproducible build, date unspecified
  63. platform: linux-x86_64
  64. options: bn(64,64) rc4(16x,int) des(idx,cisc,16,int) idea(int) blowfish(idx)
  65. 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
  66. OPENSSLDIR: "/usr/local/ssl/ssl"
  67.  
  68. 重新编译curl(找到之前编译安装的curl路径,或者直接重新下载curl二进制包进行编译安装)。注意编译安装curl时一定要添加"--with-ssl",带上openssl参数进行编译安装!
  69. # cd /usr/local/src/curl-7.64.1
  70. # ./configure --with-ssl=/usr/local/ssl
  71. # make
  72. # make install
  73.  
  74. 查看curl是否已经支持https协议:
  75. [root@bkevin ~]# curl -V
  76. curl 7.64.1 (x86_64-pc-linux-gnu) libcurl/7.64.1 OpenSSL/1.0.2k zlib/1.2.8
  77. Release-Date: 2019-03-27
  78. Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
  79. Features: AsynchDNS HTTPS-proxy IPv6 Largefile libz NTLM NTLM_WB SSL TLS-SRP UnixSockets
  80.  
  81. 由上面可知,curl现在已经可以支持https协议了,故可以使用curl访问https
  82. [root@bkevin ~]# curl -s --cacert ca.pem --cert admin.pem --key admin-key.pem https://192.168.81.172:6443/metrics |head -5
  83. # HELP APIServiceOpenAPIAggregationControllerQueue1_adds Total number of adds handled by workqueue: APIServiceOpenAPIAggregationControllerQueue1
  84. # TYPE APIServiceOpenAPIAggregationControllerQueue1_adds counter
  85. APIServiceOpenAPIAggregationControllerQueue1_adds 18601
  86. # HELP APIServiceOpenAPIAggregationControllerQueue1_depth Current depth of workqueue: APIServiceOpenAPIAggregationControllerQueue1
  87. # TYPE APIServiceOpenAPIAggregationControllerQueue1_depth gauge
  88.  
  89. ########################################################################################################################
  90. ########################################################################################################################
  91. 需要特别注意: 上面在更新openssl版本后,最好不要退出当前终端!!!
  92. 因为如上OpenSSL版本更新后,可能导致ssh远程连接失败问题!!!
  93.  
  94. [root@bkevin ~]# ssh -p22 root@192.168.36.12
  95. ssh_exchange_identification: read: Connection reset by peer
  96.  
  97. [root@bkevin ~]# ssh -v -p22 root@192.168.36.12
  98. OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017
  99. debug1: Reading configuration data /etc/ssh/ssh_config
  100. debug1: /etc/ssh/ssh_config line 58: Applying options for *
  101. debug1: Connecting to 192.168.36.12 [172.20.36.12] port 22.
  102. debug1: Connection established.
  103. debug1: permanently_set_uid: 0/0
  104. debug1: identity file /root/.ssh/id_rsa type 1
  105. debug1: key_load_public: No such file or directory
  106. debug1: identity file /root/.ssh/id_rsa-cert type -1
  107. debug1: key_load_public: No such file or directory
  108. debug1: identity file /root/.ssh/id_dsa type -1
  109. debug1: key_load_public: No such file or directory
  110. debug1: identity file /root/.ssh/id_dsa-cert type -1
  111. debug1: key_load_public: No such file or directory
  112. debug1: identity file /root/.ssh/id_ecdsa type -1
  113. debug1: key_load_public: No such file or directory
  114. debug1: identity file /root/.ssh/id_ecdsa-cert type -1
  115. debug1: key_load_public: No such file or directory
  116. debug1: identity file /root/.ssh/id_ed25519 type -1
  117. debug1: key_load_public: No such file or directory
  118. debug1: identity file /root/.ssh/id_ed25519-cert type -1
  119. debug1: Enabling compatibility mode for protocol 2.0
  120. debug1: Local version string SSH-2.0-OpenSSH_7.4
  121. ssh_exchange_identification: read: Connection reset by peer
  122.  
  123. 解决办法:在ssh在服务端更改配置文件修改:
  124. [root@bkevin ~]# vi /etc/hosts.allow
  125. #########################
  126. sshd: ALL ##允许所有ip主机均能连接本机
  127.  
  128. [root@bkevin ~]# /etc/init.d/sshd restart
  129. Stopping sshd: [FAILED]
  130. Starting sshd: /usr/sbin/sshd: /usr/lib64/libcrypto.so.10: no version information available (required by /usr/sbin/sshd)
  131. /usr/sbin/sshd: /usr/lib64/libcrypto.so.10: no version information available (required by /usr/sbin/sshd)
  132. /usr/sbin/sshd: /usr/lib64/libcrypto.so.10: no version information available (required by /usr/sbin/sshd)
  133. OpenSSL version mismatch. Built against 1000105f, you have 100020bf
  134.  
  135. 解决办法:
  136. [root@bkevin ~]# unlink /usr/lib64/libcrypto.so.10
  137. [root@bkevin ~]# cp /usr/lib64/libcrypto.so.10_bak /usr/lib64/libcrypto.so.10
  138. [root@bkevin ~]# /etc/init.d/sshd restart
  139. Stopping sshd: [FAILED]
  140. Starting sshd: [ OK ]
  141. [root@bz4paas02zk1001 ~]# /etc/init.d/sshd restart
  142. Stopping sshd: [ OK ]
  143. Starting sshd: [ OK ]
  144.  
  145. 再次尝试远程ssh连接,就正常了!
  146. [root@bkevin ~]# ssh -p22 root@192.168.36.12
  147. Authorized only. All activity will be monitored and reported
  148. Last login: Mon Mar 2 09:06:17 2020 from 172.20.20.65
  149. [root@02zk1001 ~]#

openssl版本升级操作记录的更多相关文章

  1. openssl版本升级操作记录【转】

    需要部署nginx的https环境,之前是yum安装的openssl,版本比较低,如下:   [root@nginx ~]# yum install -y pcre pcre-devel openss ...

  2. CentOS6.9下升级默认的OpenSSH操作记录(升级到OpenSSH_7.6p1)

    近期对IDC机房服务器做了一次安全漏洞扫描,漏扫结果显示服务器的OpenSSH版本太低(CentOS6默认是OpenSSH_5.3p1),存在漏洞隐患,安全部门建议升级到OpenSSH_7.6p1.升 ...

  3. nginx缓存配置的操作记录梳理

    web缓存位于内容源Web服务器和客户端之间,当用户访问一个URL时,Web缓存服务器会去后端Web源服务器取回要输出的内容,然后,当下一个请求到来时,如果访问的是相同的URL,Web缓存服务器直接输 ...

  4. centos下升级git版本的操作记录

    在使用git pull.git push.git clone的时候,或者在使用jenkins发版的时候,可能会报类似如下的错误: error: The requested URL returned e ...

  5. linux下用户操作记录审计环境的部署记录

    通常,我们运维管理人员需要知道一台服务器上有哪些用户登录过,在服务器上执行了哪些命令,干了哪些事情,这就要求记录服务器上所用登录用户的操作信息,这对于安全维护来说很有必要.废话不多说了,下面直接记录做 ...

  6. squid代理http和https方式上网的操作记录

    需求说明:公司IDC机房有一台服务器A,只有内网环境:192.168.1.150现在需要让这台服务器能对外访问,能正常访问http和https请求(即80端口和443端口)操作思路:在IDC机房里另找 ...

  7. centos6下升级git版本的操作记录

    编译go_ethereum的时候出现了错误 然后发现是自己的git没有升级成功  因为编译需要高版本的git版本  所以会编译不成功  之后执行 root@uatjenkins01 ~]# git - ...

  8. openssl 升级 操作 -1

    好多公司都会用绿盟扫描系统漏洞,里边就会涉及到ssl 漏洞,原因是openssl 版本低导致,会让你升级到指定版本.下面就介绍一下openssl 版本升级的操作方案. 一. 查看系统版本 [root@ ...

  9. 转:centos下升级git版本的操作记录

    https://www.cnblogs.com/kevingrace/p/8252517.html 在使用git pull.git push.git clone的时候,或者在使用jenkins发版的时 ...

随机推荐

  1. 洗礼灵魂,修炼python(30)--装饰器(2)—>装饰器总结+进阶使用

    在上一篇博文的经典案例中,我想你应该对装饰器有很好的了解了,不过光有那些还不够真的,还需要总结和进阶一下,所以本篇博文解析装饰器进阶. 装饰器 1.什么是装饰器? 个人理解:装饰器又叫语法糖,指的是对 ...

  2. C#语言————第一章 第一个C#程序

    第一章    第一个C#程序 ******************C#程序***************     ①:建立项目:文件-->新建-->项目-->c#-->控制台程 ...

  3. Flutter在Windows平台下的安装配置

    目录 1. 安装 Flutter SDK2. 设置环境变量3. Flutter doctor4. 安装 Android Studio5. 启动 Android Studio, 安装 Android S ...

  4. python之字符串的常用操作(转)

    1. 字符串的操作 字符串的连接操作 符号: + 格式:str1 + str2 例如:str1 = 'I Love' str2 = 'You!' print(str1 + str2) >> ...

  5. .net core 入坑经验 - 3、MVC Core之jQuery不能使用了?

    在View中添加了一段jQuery代码用来控制一个按钮的点击事件.发现运行时提示$对象没有定义,经过在浏览器右键查看源文件发现,script代码在引用jquery代码的上方,执行时jquery还未引入 ...

  6. Linux 小知识翻译 - 「版本号」的命名方式

    包括OS,所有的软件都有版本号信息.一般来说,版本号的增大表示软件的功能增强了或者修正了一些Bug,也就是表示软件更新了. 版本号的命名方式没有统一的标准.每种软件都不一样. 大部分情况下,版本号以「 ...

  7. MYSQL中的int(11)到底代表什么意思?

    对于int类型的一些基础知识其实上图已经说的很明白了,在这里想讨论下常用的int(11)代表什么意思,很长时间以来我都以为这代表着限制int的长度为11位,直到有天看到篇文章才明白,11代表的并不是长 ...

  8. solidity ecrecover

    https://solidity.readthedocs.io/en/latest/units-and-global-variables.html#mathematical-and-cryptogra ...

  9. 如何在自己设计的页面中调用metamask-2

    参考: 1)https://www.colabug.com/3204345.html 2)https://www.toptal.com/ethereum/one-click-login-flows-a ...

  10. 移动App测试实战—专项测试

       我们在进行了手工的功能测试之后,也开发了一些自动化测试用例,并且做了性能测试之后,测试工作看似比较完整了.但是当我们的App在大量的用户那里被安装和使用的时候,还是会有很多我们之前没有预料的问题 ...