Question

How do I generate a CSR key?

Hi there, I’m still kind of a huge noob to this. So I’ve created by own SSL certificate but I’d like to use one that’s been verified by a third party. However, this third party is requesting that I enter a CSR key. How do I go about generating one so I can incorporate a different SSL certificate? Thanks in advance!

Show comments

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Thanks to ryanpq for the helpful answer ; I’d like to elaborate on the answer a bit.

To the totally uninitiated in Ubuntu, as I am:

You need to log into your Ubuntu server. First, I was trying to generate a csr from terminal on my PC, using ryanpq’s:

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

Indeed, doing it from my PC, I was prompted through the list of questions - country, name, etc - and I was told a csr was generated, but I couldn’t find it anywhere on my PC.

So, log into your server with ssh or whatever you use, where the csr will be hosted on. I don’t believe the csr generated on your PC is any use.

I used sudo -s to log in as a super user. on my server, giving me root access. I put in ryanpq’s command and answered the questions that followed - name, challenge password etc.

At the end of it all, I don’t think I got a confirmation that the csr had been generated, which would have been nice.

I typed : ls -a (which means show files in currently directory)

I saw one named mycompany.csr (my company being the actual name of my business) and typed:

cat mycompany.csr (which opens that file)

The csr file opens, displaying the csr password - everything between ‘BEGIN CERTIFICATE REQUEST’ and ‘END CERTIFICATE REQUEST’

You would cd into the directory of the file you just created and would use: cat yourdomain.csr to display the CSR on screen. You could copy and paste that into whatever you need. Good luck!

Thanks guys. Now, how do I copy the CSR file to my desktop? Highlighting the text isn’t working on the console. Thanks