1. Home
  2. Servers
  3. VPS: How to create a Certificate Signing Request (CSR) for Ubuntu Server
  1. Home
  2. Web Security
  3. SSL Certificates
  4. VPS: How to create a Certificate Signing Request (CSR) for Ubuntu Server

VPS: How to create a Certificate Signing Request (CSR) for Ubuntu Server

This article provides you with steps to generate a CSR on your Ubuntu VPS server.




Step 1 – Generate Private Key
The OpenSSL package and is usually installed under /usr/local/ssl/bin. If the utility was installed elsewhere, these instructions will need to be adjusted accordingly.
Type the following command at the prompt:
openssl genrsa -des3 -out <private key file name>.key 2048
NOTE: All certificates that will expire after October 2013 must have a 2048 bit key size.
NOTE: To bypass the pass phrase requirement, omit the -des3 option when generating the private key. If the private key is left unprotected, 1-grid recommends access to the server be restricted so that only authorized server administrators can access or read the private key file.
Step 2 – Certificate Signing Request (CSR)
Type the following command at the prompt:
openssl req -new -key <private key file name>.key -out <csr file name>.csr 
This command will prompt for the following X.509 attributes of the certificate:
Country Name: Use the two-letter code without punctuation for country, for example, RSA 
State or Province: Spell out the state completely; do not abbreviate the state or province name.  For example Western Cape, not WC
Locality or City: The Locality field is the city or town where the organization is headquartered spelled in full. For example Cape Town
Company: If the company or department has an &, @, or any other symbol using the shift key in its name, the symbol must be spelled out or omitted, in order to enroll. Example: XY & Z Corporation would be XYZ Corporation or XY and Z Corporation.
Organizational Unit: This field is optional, but can be used to help identify certificates registered to an organization. The Organizational Unit (OU) field is the name of the department or organization unit making the request. To skip the OU field, press Enter on the keyboard.
Common Name: The Common Name is the Host + Domain Name. It looks like “www.company.com” or “company.com”.  RapidSSL certificates issued to the www subdomain will also include the base domain as a Subject Alternative Name.
NOTE: Please do not enter an email address, challenge password or an optional company name when generating the CSR
Once the CSR has been created proceed to enroll for the certificate.  When prompted for the CSR, please open the file with a plain-text editor (Notepad, Vi) and copy/paste the full text of the CSR into the order form.
Step 3 – Backup the private key
We recommend backing up the .key file and storing the corresponding passphrase. A good choice is to create a copy of this file onto a diskette or other removable media. While backing up the private key is not required, having one will be helpful in the instance of server failure.

Updated on October 19, 2023

Was this article helpful?

Related Articles