Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there any standard or convention for where SSL certificates and associated private keys should go on the UNIX/Linux filesystem?

Thanks.

share|improve this question
up vote 30 down vote accepted

For system wide use OpenSSL should provide you /etc/ssl/certs and /etc/ssl/private. The latter of which will be restricted 700 to root:root.

If you have an application not performing an initial privsep from root then it might suit you to locate them somewhere local to the application with the relevantly restricted ownership and permissions.

share|improve this answer
    
I have indeed, thanks Dan. – John Topley Sep 4 '09 at 16:11
2  
is this standardized somewhere? The file system hierarchy standard doesn't contain it. – cweiske Dec 4 '13 at 20:50
1  
@cweiske This seems to be historical OpenSSL convention, not formally standardized, and a very unwieldy one in my opinion. My earliest trace is this version: rpm.pbone.net/index.php3/stat/4/idpl/38501/dir/redhat_other/com/… – kubanczyk Apr 2 '15 at 21:20
    
Worth noting that this is only Debian based distros. – DWORD PTR Sep 16 '15 at 8:23

This is where Go looks for public root certificates:

"/etc/ssl/certs/ca-certificates.crt", // Debian/Ubuntu/Gentoo etc.
"/etc/pki/tls/certs/ca-bundle.crt",   // Fedora/RHEL
"/etc/ssl/ca-bundle.pem",             // OpenSUSE
"/etc/pki/tls/cacert.pem",            // OpenELEC

Also:

"/system/etc/security/cacerts", // Android
share|improve this answer

This will vary from distribution to distribution. For example, on Amazon Linux instances (based on RHEL 5.x and parts of RHEL6, and compatible with CentOS), the certificates are stored in /etc/pki/tls/certs and the keys are stored in /etc/pki/tls/private. The CA certificates have their own directory, /etc/pki/CA/certs and /etc/pki/CA/private. For any given distribution, especially on hosted servers, I recommend to follow the already-available directory (and permissions) structure, if one is available.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.