OpenSSL Generating a Private Key: Difference between revisions

From UNIX Systems Administration
Jump to navigation Jump to search
No edit summary
No edit summary
 
(8 intermediate revisions by the same user not shown)
Line 2: Line 2:
=== Apache with mod_ssl Enabled ===
=== Apache with mod_ssl Enabled ===
# Generate the private key using openssl.
# Generate the private key using openssl.
## <tt>'''# openssl genrsa -des3 -out <key_name>_passphrase.key 1024'''</tt>
## To Generate a private key with a pass phrase.
## Enter a pass phrase for the key.
### <tt>'''# openssl genrsa -des3 -out <key_name>_passphrase.key 2048'''</tt>
# Create a copy of the key with no pass phrase.
### Enter a pass phrase for the key.
## <tt>'''# cp <key_name>_passphrase.key <key_name>_nopassphrase.key'''</tt>
### Create a copy of the key with no pass phrase.
## <tt>'''# openssl rsa -in <name>_nopassphrase.key -out <name>.key'''</tt>
#### <tt>'''# cp <key_name>_passphrase.key <key_name>_nopassphrase.key'''</tt>
#### <tt>'''# openssl rsa -in <key_name>_nopassphrase.key -out <key_name>.key'''</tt>
### Verify the checksum of the key, this will be used to verify the CSR and the self signed certificate.
#### <tt>'''# openssl rsa -noout -modulus -in <key_name>.key | openssl md5'''</tt>
## To Generate a private key without a pass phrase.
### <tt>'''# openssl genrsa -out <key_name>_nopassphrase.key 2048'''</tt>
# Verify the checksum of the key, this will be used to verify the CSR and the self signed certificate.
# Verify the checksum of the key, this will be used to verify the CSR and the self signed certificate.
## <tt>'''# openssl rsa -noout -modulus -in <key_name>.key | openssl md5'''</tt>
## <tt>'''# openssl rsa -noout -modulus -in <key_name>.key | openssl md5'''</tt>
# At this point, create a backup of the <key_name>_passphrase.key and <key_name>.key on separate media.
# At this point, create a backup of all of the keys on separate media.
# For use in Apache, use the SSL key with no pass phrase to generate any CSRs.
# For use in Apache, use the SSL key with no pass phrase to generate any CSRs.


Line 15: Line 20:
# [http://www.thegeekstuff.com/2009/07/linux-apache-mod-ssl-generate-key-csr-crt-file/ How to Generate SSL key, CSR, and Self Signed Certificate for Apache]
# [http://www.thegeekstuff.com/2009/07/linux-apache-mod-ssl-generate-key-csr-crt-file/ How to Generate SSL key, CSR, and Self Signed Certificate for Apache]


[[Category:Software]]
[[Category:SSL]]
[[Category:SSL]]

Latest revision as of 19:21, 12 November 2020

Generate the Private Key File

Apache with mod_ssl Enabled

  1. Generate the private key using openssl.
    1. To Generate a private key with a pass phrase.
      1. # openssl genrsa -des3 -out <key_name>_passphrase.key 2048
      2. Enter a pass phrase for the key.
      3. Create a copy of the key with no pass phrase.
        1. # cp <key_name>_passphrase.key <key_name>_nopassphrase.key
        2. # openssl rsa -in <key_name>_nopassphrase.key -out <key_name>.key
      4. Verify the checksum of the key, this will be used to verify the CSR and the self signed certificate.
        1. # openssl rsa -noout -modulus -in <key_name>.key | openssl md5
    2. To Generate a private key without a pass phrase.
      1. # openssl genrsa -out <key_name>_nopassphrase.key 2048
  2. Verify the checksum of the key, this will be used to verify the CSR and the self signed certificate.
    1. # openssl rsa -noout -modulus -in <key_name>.key | openssl md5
  3. At this point, create a backup of all of the keys on separate media.
  4. For use in Apache, use the SSL key with no pass phrase to generate any CSRs.

Further Reading

  1. How to Generate SSL key, CSR, and Self Signed Certificate for Apache