Importing a CA Certificate in RHEL/CentOS

  1. Copy the Certificate:

    sudo cp your-ca-certificate.crt /etc/pki/ca-trust/source/anchors/
    
  2. Update the CA Trust:

    sudo update-ca-trust extract
    

Importing a CA Certificate in Ubuntu/Debian

  1. Copy the Certificate:

    sudo cp your-ca-certificate.crt /usr/local/share/ca-certificates/
    
  2. Update the CA Trust:

    sudo update-ca-certificates
    

Importing a CA Certificate in Fedora

  1. Copy the Certificate:

    sudo cp your-ca-certificate.crt /etc/pki/ca-trust/source/anchors/
    
  2. Update the CA Trust:

    sudo update-ca-trust
    

Importing a CA Certificate in SUSE/OpenSUSE

  1. Copy the Certificate:

    sudo cp your-ca-certificate.crt /etc/pki/trust/anchors/
    
  2. Update the CA Trust:

    sudo update-ca-certificates
    

Importing a CA Certificate in Arch Linux

  1. Copy the Certificate:

    sudo cp your-ca-certificate.crt /etc/ca-certificates/trust-source/anchors/
    
  2. Update the CA Trust:

    sudo trust extract-compat
    

Importing a CA Certificate in Alpine Linux

  1. Install the ca-certificates package:

    sudo apk add ca-certificates
    
  2. Copy the Certificate:

    sudo cp your-ca-certificate.crt /usr/local/share/ca-certificates/
    
  3. Update the CA Trust:

    sudo update-ca-certificates
    

Verification

To verify that the CA certificate has been correctly imported and trusted, you can use the OpenSSL tool. Run the following command:

openssl s_client -connect some-secure-site.com:443 -CApath /etc/ssl/certs

Replace /etc/ssl/certs with the appropriate directory if necessary. This command helps ensure that your system recognizes the new certificate and includes it in its list of trusted CAs.