鍍金池/ 問答/Java  Linux/ centos 如何降級(jí) openssl?

centos 如何降級(jí) openssl?

因?yàn)橐?jí)ssh,下載了ssh最新的編譯安裝包(openssh-7.6p1)、openssl的編譯安裝包(OpenSSL 1.1.0f)。

裝好openssl之后,再裝openssh,竟然提示openssh不支持1.1.0以上的openssl!

想著再按照原來的方法裝一次openssl-1.0.2l吧,真裝上了(./config shared zlib --prefix=/usr/local/openssl-1.0.2l)。

openssl version 顯示的版本卻永遠(yuǎn)是1.1.0f!openssh也還是裝不上,即使我把1.0.2l裝在一個(gè)新目錄,openssh配置openssl的目錄是新目錄,它也還是讀1.1.0fopenssl。。。

網(wǎng)上能找到的各種軟鏈、修改 /etc/ld.so.conf 的,我都試過了,1.1.0f版本好像是生根了一樣,除不掉。。。


現(xiàn)在用which openssl找出openssl的位置,用ln -s1.0.2lbin/openssl文件鏈到這了,用openssl version 顯示的版本已經(jīng)是1.0.2l了,但是治標(biāo)沒治本,裝openssh的時(shí)候,還是提示OpenSSL header version... 1010006f (OpenSSL 1.1.0f 25 May 2017),表示它不知道從哪里讀了一個(gè)1.1.0f的版本,我明明裝了低版本!

./configure --prefix=/usr/local/openssh --sysconfdir=/etc/ssh --with-pam --with-ssl-dir=/usr --with-md5-passwords --mandir=/usr/share/man --with-zlib=/usr/local/zlib

我的openssh配置語句是這樣的,我把openssl 1.0.2l裝在/usr

回答
編輯回答
我以為

啊哈哈哈哈哈哈哈哈,我解決了,感謝知乎的答友提醒我看安裝包里的 INSTALL 文件,里面很詳細(xì),雖然是全英文,但是我眼神好,看到一句 ‘make update’當(dāng)時(shí)就想,我擦,還有這個(gè)操作,即使沒理解上下文,但是先試試吧,然后重新編譯了一次openssl:
./config shared --prefix=/usr/local/openssl (這一句我其實(shí)用過幾回了,都沒有效果)
make
make update (沒想到居然不是用make install?。?/p>

//以下是編譯openssh的結(jié)果,終于識(shí)別我想裝的版本啦?。。?/p>

checking OpenSSL header version... 100020cf (OpenSSL 1.0.2l  25 May 2017)
checking OpenSSL library version... 100020cf (OpenSSL 1.0.2l  25 May 2017)
checking whether OpenSSL's headers match the library... yes
checking if programs using OpenSSL functions will link... yes
....(此處省略)
OpenSSH has been configured with the following options:
                 User binaries: /usr/local/openssh/bin
               System binaries: /usr/local/openssh/sbin
           Configuration files: /etc/ssh
               Askpass program: /usr/local/openssh/libexec/ssh-askpass
                  Manual pages: /usr/share/man/manX
                      PID file: /var/run
  Privilege separation chroot path: /var/empty
        sshd default user PATH: /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/openssh/bin
                Manpage format: doc
                   PAM support: yes
               OSF SIA support: no
             KerberosV support: no
               SELinux support: no
             Smartcard support: 
                 S/KEY support: no
          MD5 password support: yes
               libedit support: no
               libldns support: no
  Solaris process contract support: no
       Solaris project support: no
     Solaris privilege support: no
   IP address in $DISPLAY hack: no
       Translate v4 in v6 hack: yes
              BSD Auth support: no
          Random number source: OpenSSL internal ONLY
         Privsep sandbox style: seccomp_filter

          Host: x86_64-pc-linux-gnu
      Compiler: gcc
Compiler flags: -g -O2 -pipe -Wall -Wpointer-arith -Wuninitialized -Wsign-compare -Wformat-security -Wsizeof-pointer-memaccess -Wno-pointer-sign -Wno-unused-result -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -ftrapv -fno-builtin-memset -fstack-protector-strong -fPIE  
Preprocessor flags: -I/usr/local/openssl/include -I/usr/local/zlib/include  -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -D_DEFAULT_SOURCE
  Linker flags: -L/usr/local/openssl/lib -L/usr/local/zlib  -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack -fstack-protector-strong -pie 
     Libraries: -lcrypto -ldl -lutil -lz  -lcrypt -lresolv
     +for sshd:  -lpam

PAM is enabled. You may need to install a PAM control file 
for sshd, otherwise password authentication may fail. 
Example PAM control files can be found in the contrib/ 
subdirectory
2018年2月10日 21:46