리눅스 자체서명 SSL 인증서 생성

Jmnote (토론 | 기여)님의 2012년 9월 23일 (일) 18:26 판 (Openssl 인증서 설치 문서를 OpenSSL 사설인증서 설치(으)로 옮김)

Crystal Clear action info.png 작성 중인 문서입니다.
리눅스 SSL 인증서 설치

1 확인

리눅스를 설치했다면 아마도 openssl 패키지가 설치되어 있을 것이다.[1]

[root@jmnote ~]# rpm -qa openssl
openssl-1.0.0-20.el6_2.5.x86_64
[root@jmnote ~]# which openssl
/usr/bin/openssl

2 사설CA 개인키 생성

[root@jmnote ~]# openssl genrsa -des3 -out my_ca.key 2048
Generating RSA private key, 2048 bit long modulus
.....................+++
......................................................................+++
e is 65537 (0x10001)
Enter pass phrase for my_ca.key:
→ 개인키용 패스워드 입력 후 Enter
Verifying - Enter pass phrase for my_ca.key:
→ 같은 패스워드 한번 더 입력 후 Enter

3 개인키 파일 보존

파일 손실에 대비하여 복사해두자.

[root@jmnote ~]# cp ssl_jmnote.key ssl_jmnote.key.backup
[root@jmnote ~]# ll ssl_jmnote*
-rw-r--r--. 1 root root 1751 Sep 20 04:15 ssl_jmnote.key
-rw-r--r--. 1 root root 1751 Sep 20 04:19 ssl_jmnote.key.backup
→ 여기서는 로컬에 사본을 만드는 정도까지만 하지만, 실제로는 다른 컴퓨터에 복사해두는 것이 좋다.

4 인증요청서 생성

[root@jmnote ~]# openssl req -new -key ssl_jmnote.key -out ssl_jmnote.csr
Enter pass phrase for ssl_jmnote.key:
→ 개인키 패스워드 입력 후 Enter
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [XX]:KR
State or Province Name (full name) []:Seoul
Locality Name (eg, city) [Default City]:Yeongdeungpo
Organization Name (eg, company) [Default Company Ltd]:Jmnote
Organizational Unit Name (eg, section) []:Development team
Common Name (eg, your name or your server's hostname) []:www.jmnote.com
Email Address []:master@jmnote.com
→ 정보 적절히 입력
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:
→ 그냥 Enter, Enter

5 같이 보기

6 주석

  1. 리눅스는 SSH 접속을 기본 제공하는데, 거기에도 openssl이 필요하다. CentOS 6 최소 설치 패키지 목록에도 포함되어 있다.

7 참고 자료

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}