SSL Certificate Location on UNIX/Linux

Better Stack Team
Updated on November 9, 2023

In UNIX/Linux systems, SSL certificate files are often stored in specific directories. The exact location can vary based on the distribution and configuration.

Commonly, SSL certificates on UNIX/Linux systems are stored in the /etc/ssl/ directory or its subdirectories. However, this may differ based on the purpose or service using the SSL certificates. Here are the typical locations:

  1. Certificate Authority (CA) Certificates:
    • Root CA certificates are typically stored in: /etc/ssl/certs/
    • Intermediate CA certificates may also be stored here or in a specific subdirectory.
  2. Server Certificates and Keys:
    • Server SSL certificates and private keys are usually stored in: /etc/ssl/private/
    • The SSL certificate file might be in the same directory as the private key.

It's important to note that the directory structure can vary depending on the software, service, or package used on the system. Some services might have their specific locations for SSL certificates and private keys. For instance, web servers like Apache or Nginx may have configurations pointing to custom locations.

To find the SSL certificate locations, you can check the configurations of the service that uses SSL certificates. For example, in Apache, the SSL configuration file might specify the SSLCertificateFile and SSLCertificateKeyFile directives, which define the paths for the certificate and key files.

Additionally, using commands like find or locate can help search for SSL certificates. For instance:

 
sudo find /etc/ssl -name "*.crt" -o -name "*.pem"

This command searches for files with the .crt or .pem extension within the /etc/ssl directory and its subdirectories.

Keep in mind that proper permissions and access control should be maintained for SSL certificate files, especially for private keys, to ensure security.

Make your mark

Join the writer's program

Are you a developer and love writing and sharing your knowledge with the world? Join our guest writing program and get paid for writing amazing technical guides. We'll get them to the right readers that will appreciate them.

Write for us
Writer of the month
Marin Bezhanov
Marin is a software engineer and architect with a broad range of experience working...
Build on top of Better Stack

Write a script, app or project on top of Better Stack and share it with the world. Make a public repository and share it with us at our email.

community@betterstack.com

or submit a pull request and help us build better products for everyone.

See the full list of amazing projects on github