Right now I installed ubuntu 12.04.3 server which I want to access via ssh. For that reason I created a private key which I moved to
/etc/ssl/private/
I'm just wondering why there already is private key ssl-cert-snakeoil.key
in there. Where is this private key used and can I delete it?
The ssl-snakeoil.key is a key created by ssl-cert package post-install scripts. It's created for the snakeoil user and should not be deleted:
Now, what's the ssl-cert package:
So it is a certificate used to install packages that need to create SSL certificates, so the system generates one on the fly with the installation of this package.
As a side note, this package is not exclusive to Ubuntu, since it also appears in Debian.
It's a server-specific public and private key pair created when the server's Debian based OS is installed (like Ubuntu).
It is used in cases where no other SSL certificate is installed or configured, but encrypted communication is enabled and desired.
While it does securely encrypt traffic, it is insecure and thus named 'snakeoil' because it's lack of root authority signature means it is vulnerable to the most simple man-in-the-middle attacks.
Website administrators really need to reconfigure services that reference the snakeoil key with a properly signed key from their CA, like the one they hopefully use for HTTPS.