Adding Private Root CA Certificates to Linux

๐Ÿ’ก Adding Private Root CA Certificates to Linux โ€” Executive Summary

Technical architectural analysis, practical configuration manifests, and deployment instructions for Adding Private Root CA Certificates to Linux.

Linux

There are many ways to trust certificates on a Linux system, and may vary depending on the distribution you are using and your circumstances. Typically, you add a certification authority (CA) certificate to your system’s trusted root certificate store so that it automatically trusts all certificates signed by that CA. The two most common methods are described below:

1. How to use update-ca-certificates (Debian, Ubuntu and base systems)
  1. Copy certificate: Copy the CA certificate file to the /usr/local/share/ca-certificates/ directory. The certificate file must have the extension .crt.
shell
sudo cp your-ca.crt /usr/local/share/ca-certificates/
  1. Update Certificates: Run the update-ca-certificates script to update the system’s trusted certificate store.
shell
sudo update-ca-certificates
2. How to use the trust command (Fedora, CentOS, RHEL, and base systems)
  1. Add Certificate: Use the trust command to add the CA certificate as a trusted certificate. This command adds the certificate to the appropriate store and updates the associated database.
shell
sudo trust anchor your-ca.crt
  1. Verify certificate: To verify changes, you can use the trust list command to display a list of trusted certificates.
shell
trust list | grep 'your-ca'
More information:
  • The certificate file (your-ca.crt) must be in ASCII PEM format. If it is in another format (e.g. DER), you can use openssl to convert it to PEM format.
  • Each Linux system may have slightly different methods for adding and managing certificates, so it is recommended that you refer to the documentation for the system you are using.
  • Some systems may require a reboot or restart of certain services for changes to take effect. For example, Docker or other network services may need to be restarted for certificate changes to take effect.

This way you can configure your Linux system to trust certificates, which is especially useful in environments that use self-signed certificates or in-house CA certificates.

Mac

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *