免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
123下一页
最近访问板块 发新帖
查看: 32452 | 回复: 29
打印 上一主题 下一主题

[系统安全] 如何安全的升级openSSH版本[已解决] [复制链接]

求职 : Linux运维
论坛徽章:
10
丑牛
日期:2013-11-22 14:59:41数据库技术版块每日发帖之星
日期:2016-08-13 06:20:0015-16赛季CBA联赛之山西
日期:2016-08-03 10:35:38数据库技术版块每日发帖之星
日期:2016-07-31 06:20:002016科比退役纪念章
日期:2016-06-27 14:08:14数据库技术版块每日发帖之星
日期:2016-06-02 06:20:0015-16赛季CBA联赛之广东
日期:2016-05-20 15:06:2215-16赛季CBA联赛之深圳
日期:2016-01-29 16:27:402015亚冠之阿尔艾因
日期:2015-09-08 16:35:3615-16赛季CBA联赛之北京
日期:2017-03-28 18:45:36
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2017-02-06 17:37 |只看该作者 |倒序浏览
本帖最后由 夏寥寥 于 2017-02-15 12:26 编辑

最近OPENSSH新爆出了CVE-2016-10009漏洞。所以需要对生产上的OPENSSH全部升级到7.4版本。

1.经过我本地测试,发现使用源码升级时,有很多依赖包,导致升级失败。如果在生产环境装这么一大堆,确实有些吓人。如果升级失败,估计就连不上机器了。


2.参照网上的方法,有的说以防万一,升级前最后安装一下telnet,防止升级失败连不上机器。但telnet好像也不安全,升级完成后。估计还需要对它进行卸载。


请问大家都是如何对现有的OPENSSH进行升级的呢?哪些地方需要注意呢?谢谢~(^_^)

求职 : Linux运维
论坛徽章:
10
丑牛
日期:2013-11-22 14:59:41数据库技术版块每日发帖之星
日期:2016-08-13 06:20:0015-16赛季CBA联赛之山西
日期:2016-08-03 10:35:38数据库技术版块每日发帖之星
日期:2016-07-31 06:20:002016科比退役纪念章
日期:2016-06-27 14:08:14数据库技术版块每日发帖之星
日期:2016-06-02 06:20:0015-16赛季CBA联赛之广东
日期:2016-05-20 15:06:2215-16赛季CBA联赛之深圳
日期:2016-01-29 16:27:402015亚冠之阿尔艾因
日期:2015-09-08 16:35:3615-16赛季CBA联赛之北京
日期:2017-03-28 18:45:36
2 [报告]
发表于 2017-02-07 09:39 |只看该作者
本帖最后由 夏寥寥 于 2017-02-07 09:45 编辑

我在RHEL6.5上升级OPENSSL时(版本号:openssl-1.1.0d),make之后,在执行make test后提示如下错误:
  1. [root@RHEL6 openssl-1.1.0d]# make test
  2. make depend && make _tests
  3. make[1]: Entering directory `/root/openssl-1.1.0d'
  4. make[1]: Leaving directory `/root/openssl-1.1.0d'
  5. make[1]: Entering directory `/root/openssl-1.1.0d'
  6. ( cd test; \
  7.           SRCTOP=../. \
  8.           BLDTOP=../. \
  9.           PERL="/usr/local/perl/bin/perl" \
  10.           EXE_EXT= \
  11.           OPENSSL_ENGINES=.././engines \
  12.           OPENSSL_DEBUG_MEMORY=on \
  13.             /usr/local/perl/bin/perl .././test/run_tests.pl  )
  14. ../test/recipes/01-test_abort.t ............ ok   
  15. ../test/recipes/01-test_sanity.t ........... ok   
  16. ../test/recipes/01-test_symbol_presence.t .. ok   
  17. ../test/recipes/02-test_ordinals.t ......... ok   
  18. ../test/recipes/03-test_ui.t ............... ok   
  19. ../test/recipes/05-test_bf.t ............... ok   
  20. ../test/recipes/05-test_cast.t ............. ok   
  21. ../test/recipes/05-test_des.t .............. ok   
  22. ../test/recipes/05-test_hmac.t ............. ok   
  23. ../test/recipes/05-test_idea.t ............. ok   
  24. ../test/recipes/05-test_md2.t .............. skipped: md2 is not supported by this OpenSSL build
  25. ../test/recipes/05-test_md4.t .............. ok   
  26. ../test/recipes/05-test_md5.t .............. ok   
  27. ../test/recipes/05-test_mdc2.t ............. ok   
  28. ../test/recipes/05-test_rand.t ............. ok   
  29. ../test/recipes/05-test_rc2.t .............. ok   
  30. ../test/recipes/05-test_rc4.t .............. ok   
  31. ../test/recipes/05-test_rc5.t .............. skipped: rc5 is not supported by this OpenSSL build
  32. ../test/recipes/05-test_rmd.t .............. ok   
  33. ../test/recipes/05-test_sha1.t ............. ok   
  34. ../test/recipes/05-test_sha256.t ........... ok   
  35. ../test/recipes/05-test_sha512.t ........... ok   
  36. ../test/recipes/05-test_wp.t ............... ok   
  37. ../test/recipes/10-test_bn.t ............... ok   
  38. ../test/recipes/10-test_exp.t .............. ok   
  39. ../test/recipes/15-test_dh.t ............... ok   
  40. ../test/recipes/15-test_dsa.t .............. ok   
  41. ../test/recipes/15-test_ec.t ............... ok   
  42. ../test/recipes/15-test_ecdh.t ............. ok   
  43. ../test/recipes/15-test_ecdsa.t ............ ok   
  44. ../test/recipes/15-test_rsa.t .............. ok   
  45. ../test/recipes/20-test_enc.t .............. ok      
  46. ../test/recipes/20-test_passwd.t ........... ok   
  47. ../test/recipes/25-test_crl.t .............. ok   
  48. ../test/recipes/25-test_d2i.t .............. ok     
  49. ../test/recipes/25-test_pkcs7.t ............ ok   
  50. ../test/recipes/25-test_req.t .............. ok   
  51. ../test/recipes/25-test_sid.t .............. ok   
  52. ../test/recipes/25-test_verify.t ........... ok      
  53. ../test/recipes/25-test_x509.t ............. ok   
  54. ../test/recipes/30-test_afalg.t ............ skipped: test_afalg not supported for this build
  55. ../test/recipes/30-test_engine.t ........... ok   
  56. ../test/recipes/30-test_evp.t .............. ok   
  57. ../test/recipes/30-test_evp_extra.t ........ ok   
  58. ../test/recipes/30-test_pbelu.t ............ ok   
  59. ../test/recipes/40-test_rehash.t ........... 1/5
  60. <span style="background-color: orange;">#   Failed test 'Testing that we aren't running as a privileged user, such as root'
  61. #   at ../test/recipes/40-test_rehash.t line 49.
  62. # Looks like you failed 1 test of 5.
  63. ../test/recipes/40-test_rehash.t ........... Dubious, test returned 1 (wstat 256, 0x100)
  64. Failed 1/5 subtests
  65.         (less 1 skipped subtest: 3 okay)</span>
  66. ../test/recipes/70-test_asyncio.t .......... ok   
  67. ../test/recipes/70-test_bad_dtls.t ......... ok   
  68. ../test/recipes/70-test_clienthello.t ...... ok   
  69. ../test/recipes/70-test_packet.t ........... ok   
  70. ../test/recipes/70-test_sslcbcpadding.t .... ok   
  71. ../test/recipes/70-test_sslcertstatus.t .... ok   
  72. ../test/recipes/70-test_sslextension.t ..... ok   
  73. ../test/recipes/70-test_sslmessages.t ...... ok   
  74. ../test/recipes/70-test_sslrecords.t ....... ok   
  75. ../test/recipes/70-test_sslsessiontick.t ... ok   
  76. ../test/recipes/70-test_sslskewith0p.t ..... ok   
  77. ../test/recipes/70-test_sslvertol.t ........ ok   
  78. ../test/recipes/70-test_tlsextms.t ......... ok   
  79. ../test/recipes/70-test_verify_extra.t ..... ok   
  80. ../test/recipes/80-test_ca.t ............... ok   
  81. ../test/recipes/80-test_cipherlist.t ....... ok   
  82. ../test/recipes/80-test_cms.t .............. ok   
  83. ../test/recipes/80-test_ct.t ............... ok   
  84. ../test/recipes/80-test_dane.t ............. ok   
  85. ../test/recipes/80-test_dtls.t ............. ok   
  86. ../test/recipes/80-test_dtlsv1listen.t ..... ok   
  87. ../test/recipes/80-test_ocsp.t ............. ok     
  88. ../test/recipes/80-test_pkcs12.t ........... ok   
  89. ../test/recipes/80-test_ssl_new.t .......... ok     
  90. ../test/recipes/80-test_ssl_old.t .......... ok   
  91. ../test/recipes/80-test_ssl_test_ctx.t ..... ok   
  92. ../test/recipes/80-test_sslcorrupt.t ....... ok   
  93. ../test/recipes/80-test_tsa.t .............. ok     
  94. ../test/recipes/80-test_x509aux.t .......... ok   
  95. ../test/recipes/90-test_async.t ............ ok   
  96. ../test/recipes/90-test_bio_enc.t .......... ok   
  97. ../test/recipes/90-test_bioprint.t ......... ok   
  98. ../test/recipes/90-test_constant_time.t .... ok   
  99. ../test/recipes/90-test_fuzz.t ............. ok     
  100. ../test/recipes/90-test_gmdiff.t ........... ok   
  101. ../test/recipes/90-test_heartbeat.t ........ skipped: heartbeats is not supported by this OpenSSL build
  102. ../test/recipes/90-test_ige.t .............. ok   
  103. ../test/recipes/90-test_memleak.t .......... ok   
  104. ../test/recipes/90-test_p5_crpt2.t ......... ok   
  105. ../test/recipes/90-test_secmem.t ........... ok   
  106. ../test/recipes/90-test_shlibload.t ........ ok   
  107. ../test/recipes/90-test_srp.t .............. ok   
  108. ../test/recipes/90-test_sslapi.t ........... ok   
  109. ../test/recipes/90-test_threads.t .......... ok   
  110. ../test/recipes/90-test_v3name.t ........... ok   

  111. Test Summary Report
  112. -------------------
  113. ../test/recipes/40-test_rehash.t         (Wstat: 256 Tests: 5 Failed: 1)
  114.   Failed test:  4
  115.   Non-zero exit status: 1
  116. Files=91, Tests=484, 64 wallclock secs ( 0.60 usr  0.20 sys + 42.90 cusr  8.60 csys = 52.30 CPU)
  117. Result: FAIL
  118. Failed 1/91 test programs. 1/484 subtests failed.
  119. make[1]: *** [_tests] Error 255
  120. make[1]: Leaving directory `/root/openssl-1.1.0d'
  121. make: *** [tests] 错误 2
复制代码


错误提示说:我没有使用root这个特权用户来执行测试。但我使用的就是root.
打开提示错误文件的line 49,内容如下:
  1. [root@RHEL6 recipes]# vi 40-test_rehash.t
  2.       1 #! /usr/bin/env perl
  3.       2 # Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved.
  4.       3 #
  5.       4 # Licensed under the OpenSSL license (the "License").  You may not use
  6.       5 # this file except in compliance with the License.  You can obtain a copy
  7.       6 # in the file LICENSE in the source distribution or at
  8.       7 # https://www.openssl.org/source/license.html
  9.       8
  10.       9
  11.      10 use strict;
  12.      11 use warnings;
  13.      12
  14.      13 use File::Spec::Functions;
  15.      14 use File::Copy;
  16.      15 use File::Basename;
  17.      16 use if $^O ne "VMS", 'File::Glob' => qw/glob/;
  18.      17 use OpenSSL::Test qw/:DEFAULT bldtop_file/;
  19.      18
  20.       1 #! /usr/bin/env perl
  21.       2 # Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved.
  22.       3 #
  23.       4 # Licensed under the OpenSSL license (the "License").  You may not use
  24.       5 # this file except in compliance with the License.  You can obtain a copy
  25.       6 # in the file LICENSE in the source distribution or at
  26.       7 # https://www.openssl.org/source/license.html
  27.       8
  28.       9
  29.      10 use strict;
  30.      11 use warnings;
  31.      12
  32.      13 use File::Spec::Functions;
  33.      14 use File::Copy;
  34.      15 use File::Basename;
  35.      16 use if $^O ne "VMS", 'File::Glob' => qw/glob/;
  36.      17 use OpenSSL::Test qw/:DEFAULT bldtop_file/;
  37.      18
  38.      19 setup("test_rehash");
  39.      20
  40.      21 #If "openssl rehash -help" fails it's most likely because we're on a platform
  41.      22 #that doesn't support the rehash command (e.g. Windows)
  42.      23 plan skip_all => "test_rehash is not available on this platform"
  43.      24     unless run(app(["openssl", "rehash", "-help"]));
  44.      25
  45.      26 plan tests => 5;
  46.      27
  47.      28 indir "rehash.[        DISCUZ_CODE_1        ]quot; => sub {
  48.      29     prepare();
  49.      30     ok(run(app(["openssl", "rehash", curdir()])),
  50.      31        'Testing normal rehash operations');
  51.      32 }, create => 1, cleanup => 1;
  52.      33
  53.      34 indir "rehash.[        DISCUZ_CODE_1        ]quot; => sub {
  54.      35     prepare(sub { chmod 400, $_ foreach (@_); });
  55.      36     ok(run(app(["openssl", "rehash", curdir()])),
  56.      37        'Testing rehash operations on readonly files');
  57.      38 }, create => 1, cleanup => 1;
  58.      39
  59.      40 indir "rehash.[        DISCUZ_CODE_1        ]quot; => sub {
  60.      41     ok(run(app(["openssl", "rehash", curdir()])),
  61.      42        'Testing rehash operations on empty directory');
  62.      43 }, create => 1, cleanup => 1;
  63.      44
  64.      45 indir "rehash.[        DISCUZ_CODE_1        ]quot; => sub {
  65.      46     prepare();
  66.      47     chmod 0500, curdir();
  67.      48   SKIP: {
  68.      49    <b><font color="#ff0000">   if (!ok(!open(FOO, ">unwritable.txt"),</font></b>
  69.      50               "Testing that we aren't running as a privileged user, such as root")) {
  70.      51           close FOO;
  71.      52           skip "It's pointless to run the next test as root", 1;
  72.      53       }
  73.      54       isnt(run(app(["openssl", "rehash", curdir()])), 1,
  74.      55            'Testing rehash operations on readonly directory');
  75.      56     }
  76.      57     chmod 0700, curdir();       # make it writable again, so cleanup works
  77.      58 }, create => 1, cleanup => 1;
  78.      59
  79.      60 sub prepare {
  80.      61     my @sourcefiles =
  81.      62         sort map { glob(bldtop_file('certs', 'demo', "*.$_")) } ('pem',
  82.      63                                                                  'crt',
  83.      64                                                                  'cer',
  84.      65                                                                  'crl');
  85.      66     my @destfiles = ();
  86.      67     foreach (@sourcefiles) {
  87.      68         copy($_, curdir());
  88.      69         push @destfiles, catfile(curdir(), basename($_));
  89.      70     }
  90.      71     foreach (@_) {
  91.      72         die "Internal error, argument is not CODE"
  92.      73             unless (ref($_) eq 'CODE');
  93.      74         $_->(@destfiles);
  94.      75     }
  95.      76 }
复制代码



论坛徽章:
0
3 [报告]
发表于 2017-02-07 09:52 |只看该作者
先安装telnet  然后使用telnet登录系统卸载ssh   安装新版本ssh  开始允许root用户使用ssh登录   最后卸载telnet   openssh -v看版本

求职 : Linux运维
论坛徽章:
10
丑牛
日期:2013-11-22 14:59:41数据库技术版块每日发帖之星
日期:2016-08-13 06:20:0015-16赛季CBA联赛之山西
日期:2016-08-03 10:35:38数据库技术版块每日发帖之星
日期:2016-07-31 06:20:002016科比退役纪念章
日期:2016-06-27 14:08:14数据库技术版块每日发帖之星
日期:2016-06-02 06:20:0015-16赛季CBA联赛之广东
日期:2016-05-20 15:06:2215-16赛季CBA联赛之深圳
日期:2016-01-29 16:27:402015亚冠之阿尔艾因
日期:2015-09-08 16:35:3615-16赛季CBA联赛之北京
日期:2017-03-28 18:45:36
4 [报告]
发表于 2017-02-07 10:00 |只看该作者
回复 3# l495051275

谢谢!能看下上面的make test报错是怎么回事呢?

论坛徽章:
0
5 [报告]
发表于 2017-02-07 10:34 |只看该作者
回复 4# 夏寥寥
看了不知道咋回事 要不你换个包试试  我这也总升级ssh因为有漏洞 但是没遇到你那个问题

求职 : Linux运维
论坛徽章:
10
丑牛
日期:2013-11-22 14:59:41数据库技术版块每日发帖之星
日期:2016-08-13 06:20:0015-16赛季CBA联赛之山西
日期:2016-08-03 10:35:38数据库技术版块每日发帖之星
日期:2016-07-31 06:20:002016科比退役纪念章
日期:2016-06-27 14:08:14数据库技术版块每日发帖之星
日期:2016-06-02 06:20:0015-16赛季CBA联赛之广东
日期:2016-05-20 15:06:2215-16赛季CBA联赛之深圳
日期:2016-01-29 16:27:402015亚冠之阿尔艾因
日期:2015-09-08 16:35:3615-16赛季CBA联赛之北京
日期:2017-03-28 18:45:36
6 [报告]
发表于 2017-02-07 11:51 |只看该作者
回复 5# l495051275

我之前用的是openssl-1.1.0c这个版本的,也有这个问题。我再换openssl-1.1.0k试试。

求职 : Linux运维
论坛徽章:
10
丑牛
日期:2013-11-22 14:59:41数据库技术版块每日发帖之星
日期:2016-08-13 06:20:0015-16赛季CBA联赛之山西
日期:2016-08-03 10:35:38数据库技术版块每日发帖之星
日期:2016-07-31 06:20:002016科比退役纪念章
日期:2016-06-27 14:08:14数据库技术版块每日发帖之星
日期:2016-06-02 06:20:0015-16赛季CBA联赛之广东
日期:2016-05-20 15:06:2215-16赛季CBA联赛之深圳
日期:2016-01-29 16:27:402015亚冠之阿尔艾因
日期:2015-09-08 16:35:3615-16赛季CBA联赛之北京
日期:2017-03-28 18:45:36
7 [报告]
发表于 2017-02-07 17:20 |只看该作者
我在升级完OPENSSH7.4p1版本后,升级ssh版本以后,使用crt登录时,所有的用户都无法登录,使用root用户也 一样。总提示用户名和密码不匹配(ps:密码都是正确的)
报错如下:
  1. The server has disconnected with an error.  Server message reads:
  2. A protocol error occurred. Change of username or service not allowed: (root,ssh-connection) -> (xiong,ssh-connection)
复制代码

论坛徽章:
223
2022北京冬奥会纪念版徽章
日期:2015-08-10 16:30:32操作系统版块每日发帖之星
日期:2016-05-10 19:22:58操作系统版块每日发帖之星
日期:2016-02-18 06:20:00操作系统版块每日发帖之星
日期:2016-03-01 06:20:00操作系统版块每日发帖之星
日期:2016-03-02 06:20:0015-16赛季CBA联赛之上海
日期:2019-09-20 12:29:3219周年集字徽章-周
日期:2019-10-01 20:47:4815-16赛季CBA联赛之八一
日期:2020-10-23 18:30:5320周年集字徽章-20	
日期:2020-10-28 14:14:2615-16赛季CBA联赛之广夏
日期:2023-02-25 16:26:26CU十四周年纪念徽章
日期:2023-04-13 12:23:10操作系统版块每日发帖之星
日期:2016-05-10 19:22:58
8 [报告]
发表于 2017-02-08 10:52 |只看该作者
rhel难道没有买订阅,然后自己打补丁的情况

求职 : Linux运维
论坛徽章:
10
丑牛
日期:2013-11-22 14:59:41数据库技术版块每日发帖之星
日期:2016-08-13 06:20:0015-16赛季CBA联赛之山西
日期:2016-08-03 10:35:38数据库技术版块每日发帖之星
日期:2016-07-31 06:20:002016科比退役纪念章
日期:2016-06-27 14:08:14数据库技术版块每日发帖之星
日期:2016-06-02 06:20:0015-16赛季CBA联赛之广东
日期:2016-05-20 15:06:2215-16赛季CBA联赛之深圳
日期:2016-01-29 16:27:402015亚冠之阿尔艾因
日期:2015-09-08 16:35:3615-16赛季CBA联赛之北京
日期:2017-03-28 18:45:36
9 [报告]
发表于 2017-02-08 13:16 |只看该作者
回复 8# action08

没有购买订阅。并且我们的机器都是内网的,禁止连外网。

论坛徽章:
17
巨蟹座
日期:2014-11-20 23:04:5215-16赛季CBA联赛之北控
日期:2018-08-01 16:08:4015-16赛季CBA联赛之浙江
日期:2017-12-08 11:25:2415-16赛季CBA联赛之四川
日期:2016-11-21 00:16:50操作系统版块每日发帖之星
日期:2016-07-28 06:20:0015-16赛季CBA联赛之吉林
日期:2016-05-25 15:36:04操作系统版块每日发帖之星
日期:2016-02-12 06:20:002015亚冠之西悉尼流浪者
日期:2015-08-28 14:48:322015亚冠之平阳省
日期:2015-08-19 14:54:162015亚冠之武里南联
日期:2015-07-07 10:49:112015亚冠之城南
日期:2015-06-22 10:15:002015亚冠之山东鲁能
日期:2015-06-18 18:03:44
10 [报告]
发表于 2017-02-08 13:56 |只看该作者
回复 9# 夏寥寥

就算是内网,使用RHEL还是建议有订阅的,至少能获得红帽的升级用二进制安装包吧。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP