OpenSSL β€’ Generation & Keys

How to Remove Passphrase from an RSA Private Key for NGINX/Apache

When an RSA private key is encrypted with AES or DES, web servers prompt for the passphrase every time the process starts or reloads. Removing the passphrase creates an unencrypted key that NGINX, Apache, and Docker containers can read unattended.

Remove Passphrase from Key Command
Caution β€’ Private Key Handling / Decryption
openssl rsa -in encrypted.key -out decrypted.key
Customize:
Domain:
Cert File:

OpenSSL Flags & Options Explained

-in encrypted.keySource passphrase-protected private key
-out decrypted.keyDestination unencrypted private key

Execution Steps & Verification

1Decrypt the key

Run the decryption command and enter the passphrase when prompted:

openssl rsa -in encrypted.key -out decrypted.key
2Secure the unencrypted key file

Restrict file access permissions to owner read/write:

chmod 600 decrypted.key
3Verify header difference

Check that DEK-Info header is gone and file begins with standard `BEGIN RSA PRIVATE KEY`:

head -n 5 decrypted.key

Common Security Pitfalls & Solutions

  • Ensure the server hosting the decrypted key has strict file permissions, as anyone with read access can impersonate the certificate.

Prerequisites & Environment

  • Encrypted private key and its current passphrase.

Frequently Asked Questions About Remove Passphrase from Key

Frequently Asked Questions

Frequently Asked Questions

Everything you need to know regarding specifications, syntax, and security best practices.

Run: `openssl rsa -aes256 -in decrypted.key -out encrypted.key` and enter your desired new passphrase.