Can anyone point me to a good tutorial on installing a root certificate on Ubuntu?
I've been provided with a .crt
file. I gather that need to create a directory at /usr/share/ca-certificates/newdomain.org
and place the .crt
in that directory. Beyond that I'm not sure how to proceed.
Given a CA certificate file
foo.crt
, follow these steps to install it on Ubuntu:Create a directory for extra CA certificates in
/usr/local/share/ca-certificates
:Copy the CA
.crt
file to this directory:Let Ubuntu add the
.crt
file's path relative to/usr/local/share/ca-certificates
to/etc/ca-certificates.conf
:To do this non-interactively, run:
In case of a
.pem
file on Ubuntu, it must first be converted to a.crt
file:Or a
.cer
file can be converted to a.crt
file:Given a CA certificate file 'foo.crt', follow these steps to install it on Ubuntu:
First, copy your CA to dir
/usr/local/share/ca-certificates/
then, update CA store
That's all. You should get this output:
No file is needed to edit. Link to your CA is created automatically.
Please note that the certificate filenames have to end in
.crt
, otherwise theupdate-ca-certificates
script won't pick up on them.This procedure works also in newer versions: manuals.
Clarification between
update-ca-certificates
anddpkg-reconfigure ca-certificates
and why one works and the other does not!!update-ca-certificates
orsudo update-ca-certificates
will only work if/etc/ca-certificates.conf
has been updated./etc/ca-certificate.conf
is only updated once you randpkg-reconfigure ca-certificates
which updates the certificate names to be imported into/etc/ca-certificates.conf
.This is stated in the header of the
/etc/ca-certificates.conf
file:As you can see, the format in
/etc/ca-certificates.conf
is<folder name>/<.crt name>
So in order to use
update-ca-certificates
orsudo update-ca-certificates
you could do the following to import a .crt:Create a directory for extra CA certificates in /usr/share/ca-certificates:
Copy the .crt file to this directory:
Append a line to
/etc/ca-certificates.conf
using<folder name>/<.crt name>
:Update certs non-interactively with sudo update-ca-certificates
Install a Certificate Authority on Ubuntu
I have tested this on Ubuntu 14.04.
Here is my solution, I looked and looked for a long time trying to figure out how to get this to work.
certutil -config - -ping
will show you the ones you are using if you are behind a corporate proxy)openssl x509 -inform DER -in certificate.cer -out certificate.crt
sudo mkdir /usr/share/ca-certificates/extra
sudo cp certificate.crt /usr/share/ca-certificates/extra/certificate.crt
sudo update-ca-certificates
sudo nano /etc/ca-certificates.conf
!
from in front of the file name (update-ca-certificates doc) - if you don't find your certificate rundpkg-reconfigure ca-certificates
sudo update-ca-certificates
Other answers didn't work for me with Ubuntu 18.04. Append the certificate cert to
/etc/ssl/certs/ca-certificates.crt
using the following command:Have the (root / CA) certificate available on a web server, local to your network if you like.
Update: It will be necessary to check if this works on Ubuntu 11. I've realised that I just did this on Ubuntu 12.04 LTS.
From here:
Installing the Certificate
You can install the key file example.key and certificate file example.crt, or the certificate file issued by your CA, by running following commands at a terminal prompt:
Now simply configure any applications, with the ability to use public-key cryptography, to use the certificate and key files. For example, Apache can provide HTTPS, Dovecot can provide IMAPS and POP3S, etc.
To add a Root CA certificate in FireFox is now-a-days very easy. Just open preferences, go to "Privacy & Security", scroll down to "Certificates" and click "View Certificates...". Here you can click "Import Certificate". Point to your root CA (.pem) and OK. That's all folks.
Here are the simple steps:
Install CA certificates to allow SSL-based applications to check for the authenticity of SSL connections:
Copy certificate file (
crt
or.cer
) into/usr/local/share/ca-certificates/
folder, e.g.:For PEM file, see: Convert .pem to .crt and .key.
Optionally, if using Charles proxy, this command can work:
Update certificates:
The command will update
/etc/ssl/certs
directory to hold SSL certificates and generatesca-certificates.crt
file (a concatenated single-file list of certificates).Note: Don't add certificates manually (as suggested here), as they are not persistent and going to be removed.
Note: If you're running as
root
, you can drop thesudo
from the above commands.