본문 바로가기

리눅스

[리눅스] SSL 인증서 개인비 비밀번호 제거

728x90

SSL 인증서 개인비 비밀번호 제거

SSL 인증서(crt) 및 키(key) 생성

openssl req -subj '/CN=sangchul.kr/O=Infrastructure Team/C=KR' -new -newkey rsa:2048 -sha256 -days 365 -nodes -x509 -keyout node1.key -out node1.crt
$ openssl req -subj '/CN=sangchul.kr/O=Infrastructure Team/C=KR' -new -newkey rsa:2048 -sha256 -days 365 -nodes -x509 -keyout node1.key -out node1.crt
...+.................+...+.......+..+......+.+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*...+.+.....+......+.........+.+.....+....+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*.+...........+....+..+.............+..+..................+.+.....+....+.....+.......+...............+........+......+.........+....+...+..+............+...+...+...+..........+......+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
...+.....+....+.....+.............+..+.+.....+.......+..+.+..+...+............+......+.+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*......+......+.+...+.....+.+...........+.......+...........+....+..+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*....+...............+..+....+...........+....+.........+..+......+.......+...+..+..........+...+...+.....+.+.....+...+.+..+....+..................+...........+.......+..............+..........+...+......+......+...+..+...+.+.....+.+.....+....+..+.......+........+........................+......+............+.+..+....+...............+........+.+...........+....+..+..........+...............+.....+...+......+.+...+..+....+.........+..+...+....+.....+.+..+...+.........+......+.......+..+...+...+.+.....+...+.............+.....+...+.........+...+............+.+..+............+...+.............+...........+...+.+..+...+.......+.....+...+.+.....+.+........+....+.....+.......+...+.....+...+........................+.+..+.+.....+.+.....+....+.....+....+.....+..........+..+.+.....+.......+............+..........................+.......+..+.........+......+.............+........+...+......+.............+......+......+...+........+.......+...+.....+...+......+.+.........+........+...+....+...+..+.+..+......+.+......+...+...........+.+..+..........+.....+.......+......+.....+...+.........+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-----
$ ls
node1.crt  node1.key

SSL 인증서 개인비 비밀번호 추가/확인/제거/변경

SSL 인증서 키 파일의 비밀번호 추가(비밀번호 : P@ssw0rd)

openssl rsa -in node1.key -passout pass:'P@ssw0rd' -out node1.key -des3
$ openssl rsa -in node1.key -passout pass:'P@ssw0rd' -out node1.key -des3
writing RSA key

SSL 인증서 키 파일의 비밀번호 확인(검증)

openssl rsa -in node1.key
$ openssl rsa -in node1.key
Enter pass phrase for node1.key:
writing RSA key
-----BEGIN PRIVATE KEY-----
MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDYS0CQGI33vR/w
HHtL4c0ABuK+zwRauAJyu6CJrBjA2QHEyUIrqoNtsHoSd/ogUfdqztQJb2H6tLGg
Eqz3yBEVaQ1S5J6WRVlgn5laGGh+ST36JBc8MR4hQ3dZsxPD7+GiiMmxh5cz91WH
VgsvS/ovcYsoyH23+hcUNfP2U62yPqB0DDZCERAyEuEUGbIST12TGHHEGfrT+nG7
zp7HNSni7tUcuiI2YB/kY6SI9qY1lFFm/6vJb7oBqwN7J4zHP6XVIYLcY5vjieLF
yGqwrBgRQALGHM0XI1N7dvi0alChtrn0lEN7ASOfqU+/ucu5Vucvo0pIGRNBVIMj
TQShbB73AgMBAAECggEAArG1RSuOdnvcQ6ZnLBkiROd7uDq7PXy18xiT4Fh3b8zZ
hnT8plntDIG6k4j7tvQDwUiAQE8rM5nqmH7YZAxm7L2ulSNp4kn3hLTtjmoSwHfz
FgQ7EdyJboqjmEdwbewKrcvxueIMJ8aN7INNh7JKPysKkQsmSGi3aYtegD6nQZAb
mD/Mo19C31q5a/bPx5t/gnIK8lPCi17vcql1e8DVyujFPnQ+yWuanOXVdu5/wB6i
k8LjhI0LkhL7ORxljFVRN+3qZmQTrWmD/b7QaUGWXfSPvsB2Dx5qxYOdvX0o5jho
6JVXdSuIfICKYKfNwFwBl9WDtMLgOM0kLQT3Br280QKBgQD+a3kZ7jIgUdwI/cHw
aWT8CbAHkJ3IpscprJRn8vE/i9cGGgsWH49ZMO8tIJCo9IbiVQPk+DV95/EDkc+9
noWd5r/szrXQtzNv8vBYiA4KMLU+i2fy1wvIZEP5ce/OB1CTXhEiOX/IVvn8Vxpv
UCaEr51uPXEA8jRL1jbhphZlSQKBgQDZoyi7X0vjPlC721A0uSKv9CvfRBfilhrg
stmUof1k0+/vCBIRhnAtghR/HLpyWHONeCy2/+GoW9O52IcqL+CI85DWCSOUjvSw
T7eDIt5a9NgBYxiIAq/G556wuQy730skFNBDEYcb7Rsi8tyyzt7dRXNzASuu5Tmf
40FmFEmiPwKBgBz02HSmEphxGK0BTKhzJmY1KA7EW+DxcmuA0+c81E5aOR/dqPNc
pjENi7tEIJLKOevapzXRNi1dT6YLW2yGdUiycZefMzxNDZKpQMeivI5WWtqCfVM7
PIETQFVMrXFyja4oH6UYjD2eAJfCxiRzJ98kKbPZVFo6Ns+G0vo9sADZAoGBAIl5
zSL/AXrcRDdGRBXp1IV9IbF42/Wfh/7kOxjucpgcYHWHjZJQb8/vWW8qAIR2Zxe4
D9bRMAQfbVD5+/ekIpuf75+kSjtvShWNZYiKoBaoj0HhDP/tYoesi8tqOSb72AVE
uIGFMulrDzc2Xj78+j6fvlupI6To20uqTAdlTVYVAoGAD5CkAMuGje4T8aRBurh1
++RhBHzKY9s2tF5HQ+PkxuwoSDk7attbSxKZYsNTvdz+z/pQ/FkODcv51GZfwDcD
Id5Z5TzEdOQWIs0ycU9n7/16xapkbGq23g8Ys4SZCUFkYqmdinUJFJPZpaOFZlgp
MEvSupLGzA+18TNhr8imEZQ=
-----END PRIVATE KEY-----

SSL 인증서 키 파일의 비밀번호 제거

openssl rsa -in node1.key -out nopassword-node1.key
$ openssl rsa -in node1.key -out nopassword-node1.key
Enter pass phrase for node1.key:
writing RSA key

SSL 인증서 키 파일의 비밀번호 변경

- node1.key 비밀번호 입력 : P@ssw0rd

- 변경할 비밀번호 입력 : changepassword1!

openssl rsa -des3 -in node1.key -out changepassword-node1.key
$ openssl rsa -des3 -in node1.key -out changepassword-node1.key
Enter pass phrase for node1.key:
writing RSA key
Enter pass phrase:
Verifying - Enter pass phrase:

 

참고URL

- SSL 인증서 개인비 비밀번호 제거 https://scbyun.com/46

- 자체 서명된 SSL 인증서 생성 : https://scbyun.com/835

 

728x90