데비안 9.5에서 openssl을 작동시키는 방법

데비안 9.5에서 openssl을 작동시키는 방법

이것은 내가 사용하는 배포판입니다

  root@ci-server:~/temp# lsb_release -a
    No LSB modules are available.
    Distributor ID: Debian
    Description:    Debian GNU/Linux 9.5 (stretch)
    Release:        9.5
    Codename:       stretch

openssl을 설치할 때 다음 메시지가 표시되지만 사용이 openssl전혀 작동하지 않습니다.

root@ci-server:~/temp# apt-get install openssl
Reading package lists... Done
Building dependency tree
Reading state information... Done
openssl is already the newest version (1.1.0j-1~deb9u1).
0 upgraded, 0 newly installed, 0 to remove and 17 not upgraded.
root@ci-server:~/temp# openssl version
openssl: error while loading shared libraries: libcrypto.so.1.1: cannot open shared object file: No such file or directory

그런데 libcrypto.so.1.1여기서 발견

root@ci-server:~/temp# find / -name "libcrypto.so.1.1"
/usr/lib64/libcrypto.so.1.1

ldconfig콘텐츠

root@ci-server:~# cat /etc/ld.so.conf
include /etc/ld.so.conf.d/*.conf

그리고

root@ci-server:~# ls -l /etc/ld.so.conf.d/
total 12
-rw-r--r-- 1 root root 38 Jan 17  2017 fakeroot-x86_64-linux-gnu.conf
-rw-r--r-- 1 root root 44 Mar 20  2016 libc.conf
-rw-r--r-- 1 root root 68 Jan 14  2018 x86_64-linux-gnu.conf

/usr/lib64내부를 검색해 /etc/ld.so.conf.d도 결과가 나오지 않았습니다.

root@ci-server:~# grep -irl "/usr/lib64" /etc/ld.so.conf.d/
root@ci-server:~#

답변1

libcrypto.so.1.1Debian 9.5에서 예상되는 위치는 ... /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1대신 Debian 패키징의 OpenSSL용 라이브러리가 포함 /usr/lib64된 패키지입니다 . 패키지에는 구성 파일, 명령 바이너리 및 관련 매뉴얼 페이지만 포함되어 있습니다. 이 패키지(및 OpenSSL 라이브러리가 필요한 모든 것)는 이에 의존합니다 . 이러한 방식으로 패키지 관리를 사용하면 명령줄 도구가 필요하지 않고 사용 가능한 최소 수준의 임베디드 시스템 등을 구축하는 경우에만 라이브러리를 설치할 수 있습니다. 저장 공간.libssl1.1openssl/usr/bin/openssl/usr/bin/c_rehashopenssllibssl1.1openssl

x86_64 아키텍처에 Debian 9.x를 새로 설치하면 /usr/lib64거기에 없어야 합니다. 이것이 존재한다는 사실은 openssl다른 복사본이 일부 대체 소스에서 설치되었을 수 있음을 시사합니다(아마도 다른 호스트에서 바이너리를 복사하거나 다른 배포용 패키지를 설치하여).

실행하여 시스템에 있는 패키지의 무결성을 확인하십시오 dpkg --verify libssl1.1 openssl. 출력에는 수정된 모든 파일이 나열됩니다. 예를 들어 출력에 바이너리가 나열되어 있으면 시스템이 변조되었음을 알 수 있습니다.libssl1.1openssl/usr/bin/opensslopenssl

최악의 시나리오는 시스템이 해킹되었고 침입자가 OpenSSL을 수정된 버전으로 교체하려고 시도하여 개인 키가 침입자에게 노출되는 것입니다. 그렇다면 침입자는 /usr/lib64Debian 시스템에서 RHEL/CentOS/Fedora 스타일 시스템용 라이브러리 세트(보통 PATH 사용)를 사용하여 실수를 저질렀을 수 있습니다.

시스템이 해킹당했다고 생각되는 경우:당황하지 말 것. 서버 장애가 발생했습니다.서버가 해킹되었다고 의심되는 경우 어떻게 해야 하는지에 대한 표준적인 답변입니다.

관련 정보