๐ก 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)
- 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/
- Update Certificates: Run the
update-ca-certificatesscript 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)
- Add Certificate: Use the
trustcommand 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
- Verify certificate: To verify changes, you can use the
trust listcommand 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 useopensslto 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




Leave a Reply