728x90
우분투에 OpenSSL을 설치하는 방법(openssl-1.1.1)
테스트 환경
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04 LTS
Release: 22.04
Codename: jammy
$ openssl version
OpenSSL 3.0.2 15 Mar 2022 (Library: OpenSSL 3.0.2 15 Mar 2022)
컴파일에 필요한 패키지
apt install -y build-essential checkinstall zlib1g-dev
openssl 패키지 다운로드 및 체크섬 확인
- OpenSSL : https://www.openssl.org/source/
curl -fsSL https://www.openssl.org/source/openssl-1.1.1n.tar.gz --output /usr/local/src/openssl-1.1.1n.tar.gz
curl -fsSL https://www.openssl.org/source/openssl-1.1.1n.tar.gz.sha256 --output /usr/local/src/openssl-1.1.1n.tar.gz.sha256
echo "$(cat openssl-1.1.1n.tar.gz.sha256) openssl-1.1.1n.tar.gz" | sha256sum --check
$ echo "$(cat openssl-1.1.1n.tar.gz.sha256) openssl-1.1.1n.tar.gz" | sha256sum --check
openssl-1.1.1n.tar.gz: OK
openssl 설치 및 설정
openssl 설치
tar xfz /usr/local/src/openssl-1.1.1n.tar.gz -C /usr/local/src/
./config --prefix=/usr/local/ssl --openssldir=/usr/local/ssl shared zlib
make && make install
echo "/usr/local/ssl/lib" > /etc/ld.so.conf.d/openssl-1.1.1n.conf
ldconfig -v
environment 편집
- /usr/local/ssl/bin 추가
vim /etc/environment
$ vim /etc/environment
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/local/ssl/bin"
source /etc/environment; echo $PATH | grep '/usr/local/ssl/bin'
$ echo $PATH | grep '/usr/local/ssl/bin'
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/local/ssl/bin
728x90
설치된 openssl 버전 확인
cd /usr/local/ssl/bin; ./openssl version
$ cd /usr/local/ssl/bin
$ ./openssl version
OpenSSL 1.1.1n 15 Mar 2022
심복릭 링크 설정
$ which openssl
/usr/local/ssl/bin/openssl
ln -s /usr/local/ssl/bin/openssl /usr/bin/openssl
기존 openssl 제거
apt remove -y openssl
apt autoclean && apt autoremove
새로운 세션에서 설치된 openssl 현재 버전 확인
$ su -
$ openssl version
OpenSSL 1.1.1n 15 Mar 2022
참고URL
- OpenSSL 최신 버전으로 업그레이드 : https://scbyun.com/1400
728x90
'리눅스' 카테고리의 다른 글
우분투에서 APT 패키지 매니저를 사용하여 APM 스택을 설치하는 방법 (0) | 2022.04.28 |
---|---|
Docker 컨테이너 내에서 systemd 또는 /sbin/init을 사용하는 방법 (0) | 2022.04.28 |
리눅스에서 운영체제 및 버전을 구분하는 스크립트 (0) | 2022.04.25 |
[draft] lsb_release 명령어 (0) | 2022.04.25 |
[리눅스] IP 계산기(ipcalc/sipcalc) (0) | 2022.04.24 |