秘密鍵のパスワードを解除するには?

ショコラ
ショコラ

秘密鍵のパスワードを解除するには?

「openssl rsa -in {秘密鍵のファイル} -out {パスワード解除後の秘密鍵のファイル}」でキメマス。

サーバー証明書を設定するまでの流れ
①秘密鍵を作成
②パスワード解除した秘密鍵を作成 ←ここの話
③csrを作成
④サーバー証明書取得
⑤サーバーにサーバー証明書を設定

もっさん先輩
もっさん先輩
openssl rsa -in {秘密鍵のファイル} -out {パスワード解除後の秘密鍵のファイル}
# openssl rsa -in {秘密鍵のファイル} -out {パスワード解除後の秘密鍵}
Enter pass phrase for answorz.com.key:{パスワード入力}
writing RSA key

openssl rsa -in answorz.com.key -out answorz.com.key.nopass
# openssl rsa -in answorz.com.key -out answorz.com.key.nopass
Enter pass phrase for answorz.com.key:123456
writing RSA key

手順

秘密鍵を作成して、パスワード解除した秘密鍵を作成する手順。

  1. 秘密鍵を作成します。
openssl genrsa -des3 -out {ホスト名}.key 2048

ポイントは末尾にある 2048 です。

秘密鍵を作成します。

# openssl genrsa -des3 -out {ホスト名}.key 2048
Generating RSA private key, 2048 bit long modulus
............................................+++
.........+++
e is 65537 (0x10001)
Enter pass phrase for answorz.com.key:{パスワード入力}
Verifying - Enter pass phrase for answorz.com.key:{パスワード入力}
  1. 秘密鍵のパスワードを解除します。
openssl rsa -in {秘密鍵のファイル} -out {パスワード解除後の秘密鍵のファイル}

秘密鍵に設定したパスワードを入力すると、パスワードを解除した秘密鍵が作成されます。

# openssl rsa -in {秘密鍵のファイルなみかっこ -out {パスワード解除した秘密鍵}
Enter pass phrase for answorz.com.key:{パスワード入力}
writing RSA key

以上

Scroll to Top