Search Our Database
Obtaining the private key and certificate on Linux servers
Introduction
For Linux-based web servers like Apache and Nginx, accessing the private key and SSL certificate is crucial for securing website communications. These files ensure encrypted data transfer, and their locations may vary depending on the server configuration. This guide will walk through locating and verifying these files on Linux servers.
Prerequisites
- SSH access to the Linux server
- Root or sudo privileges
- Paths for the private key and certificate files
Step-by-Step Guide
Step 1: Locate the Private Key
- For Apache, check /etc/ssl/private/ for a .key file.
/etc/ssl/private/example.com.key
- For Nginx, check /etc/nginx/ssl/.
/etc/nginx/ssl/example.com.key
Step 2: Retrieve the SSL Certificate
- Apache: Look in /etc/ssl/certs/ for a .crt or .pem file.
/etc/ssl/certs/example.com.crt
- Nginx: Check /etc/nginx/ssl/ for .crt.
/etc/nginx/ssl/example.com.crt
Step 3: Match the Key and Certificate
Use OpenSSL to confirm matching:
openssl rsa -noout -modulus -in /path/to/private.key | openssl md5 openssl x509 -noout -modulus -in /path/to/certificate.crt | openssl md5
Step 4: Backup
Create secure backups of both files.
Conclusion
This guide covers accessing and verifying SSL private keys and certificates on Linux servers. Should you have any inquiries about the guidelines, please feel free to open a ticket through your portal account or contact us at support@ipserverone.com. We’ll be happy to assist you further.