Monday, May 28, 2012

Check If A Certificate & Private Key Match

Check if an SSL certificate and private key match in two simple commands. The OpenSSL commands below will require you to replace <file> with your file’s name.

For your SSL certificate:
openssl x509 -noout -modulus -in (Certificate file) | md5sum


For your RSA private key:

openssl rsa -noout -modulus -in (Key file) | md5sum

The output of these commands should be identical. If it isn’t, your keys do not match.
  1. The pipe to md5sum is solely to make the output shorter and easier to visually compare 
  2.  

How do I generate a CSR and private key?

You need to generate a CSR and private key on the server that the certificate will be used on. You can find instructions in your server documentation or try the instructions from one of these certificate authorities:

Once you have your CSR generated, you can use our SSL Wizard to find the best SSL certificate that will meet your needs. If you are familiar with OpenSSL you can use the following command to generate a CSR and private key:
openssl req -new -keyout server.key -out server.csr

How do I decode a CSR?

You can easily decode your CSR to see what is in it by using our CSR Decoder. In order to decode a CSR on your own machine using OpenSSL, use the following command:
openssl req -in server.csr -noout -text
     

Monday, May 14, 2012

List top 5 files eating your disk space

List top 5 files eating your disk space in current dir:

du -hsx * | sort -rh | head -5

du -hsx * | sort -rh | head -10

du -hsx * | sort -rh >/tmp/out.txt
26