Home / Tutorials / How to Generate a CSR in Ubuntu?

How to Generate a CSR in Ubuntu?

In this tutorial, we will show you how to generate a CSR in Ubuntu, specifically on an Ubuntu-based Apache server via the secure shell (SSH) protocol.

Just follow the steps below:

Step 1: Use the SSH command to log into your server

Step 2: Create the private key and CSR files

At the prompt enter the following command:

openssl req -new -newkey rsa:2048 -nodes -keyout mydomain.key -out mydomain.csr

Don’t forget to replace mydomain with your actual domain name. For example, if your domain name is example.com, you must type example.key and example.csr

Step 3: Fill in your details

Provide up-to-date details about your company to the Certificate Authority. Follow the examples below:

  • Country Name – enter the two-letter code of the country where your business is legally registered, i.e., “US”.
  • State or Province – submit the full name of the state or province where your company is registered
  • City or Locality – submit the full name of the city where your organization is registered
  • Organization Name – For Business Validation and Extended Validation certificates, enter your organization’s legal name (e.g. GPI Holding LLC). For Domain Validation certificates, type your full name
  • Organizational Unit Name – Usually it’s the department responsible for SSL management. For example, “IT” or “Web Administration”
  • Common Name – enter the FQDN (fully qualified domain name) you want to secure, for example, ssldragon.com.
    Note: If you’ve bought a wildcard certificate, add an asterisk in front of your domain name, but don’t include https or any other characters; for example, *.ssldragon.com
  • Email Address – enter a valid email address
  • A challenge password – this extra attribute is optional. You may create a password to secure your SSL certificate further. Make sure you remember it.
  • An optional company name – this field is self-explanatory. You may add an optional name for your company

Congratulations! You’ve successfully created the Certificate Signing Request key on Ubuntu.

The newly generated files are yourdomain.csr, and yourdomain.key. You can use the ls command to find them in your working directory.

Open a text editor such as Notepad to copy the CSR file and submit it to the Certificate Authority during your order process.