Knowledge Base
How To Create a Self-Signed SSL Certificate in Linux
You can create a self-signed SSL certificate in Linux by following these instructions:
- Open your VPS console from the Power Management control panel.
- Log in to your VPS by entering your username and password.
- Create an SSL private key using the following command:
# openssl genrsa -des3 -out self-ssl.key 2048
The output should look like this:
Generating RSA private key, 1024 bit long modulus ...++++++ ...............++++++ e is 65537 (0x10001) Enter pass phrase for self-ssl.key: Type-Your-PassPhrase-Here Verifying - Enter pass phrase for self-ssl.key: Retype-Your-PassPhrase-Here
- Create a Certificate Signing Request (CSR) using the following command:
# openssl req -new -key self-ssl.key -out self-ssl.csr
The output should look like this:
Enter pass phrase for self-ssl.key: Type-Your-PassPhrase-Here You are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank For some fields there will be a default value, If you enter '.', the field will be left blank. ----- Country Name (2 letter code) [XX]:AU State or Province Name (full name) []:WA Locality Name (eg, city) [Default City]:Perth Organization Name (eg, company) [Default Company Ltd]:samplecompany pty Organizational Unit Name (eg, section) []:IT Common Name (eg, your name or your server's hostname) []:myserver.example.com Email Address []:[email protected] Please enter the following 'extra' attributes to be sent with your certificate request A challenge password []: An optional company name []:
- Generate the SSL certificate using the following command:
# openssl x509 -req -days 365 -in self-ssl.csr -signkey self-ssl.key -out self-ssl.crt
The output should look like this:
Signature ok subject=/C=AU/ST=WA/L=Perth/O=samplecompany pty LTD/OU=IT/CN=myserver.example.com/emailAddress= [email protected] Getting Private key
Congratulations, you have сreated self-signed SSL certificate in Linux.
* Your feedback is too short