Безпека

How Do I Create a .CRT File in Linux?

How Do I Create a .CRT File in Linux?

Files with the .CRT extensions are normally SSL/TLS certificates. The .CRT extension is one of the most commonly used SSL/TLS certificate formats in Linux and other Unix-like systems.

This tutorial will answer your question regarding creating a .CRT certificate file in Linux using the OpenSSL tool.

Prerequisites

Install OpenSSL

OpenSSL is an open-source that you can use to create self-signed SSL/TLS certificates with the .crt extension. You may already have the OpenSSL tool available on your Linux machine. Run the command below to confirm.

$ OpenSSL version

Figure 1: Check OpenSSL version

If OpenSSL is not already installed, then run the next command.

On Ubuntu/Debian based distributions:

$ sudo apt install OpenSSL

On CentOS/Red Hat-based distributions:

$ sudo dnf install OpenSSL

The syntax for using the OpenSSL tool is:

OpenSSL command options arguments

Get a Private Key and a Certificate Signing Request File

Next, run the first command below to generate your private key. And the second command will output a certificate signing request (CSR) file.

$ openssl genrsa -out private.key
$ openssl req -new -key private.key -out request.csr

Here's a description of each command and option.

Figure 2: Private key and CSR file

You require your private key to sign the SSL/TLS certificate. The CSR file will hold information about the entity for creating the SSL/TLS certificate. You would be prompted to enter your information accordingly.

Note: While generating the CSR file, you may leave some fields blank by hitting enter on the keyboard. It is okay to leave the fields under 'extra' attributes blank.

Create a .CRT File

After the private key and CSR files are generated, it is time to create your .crt file.

$ openssl x509 -req -days 365 -in request.csr -signkey private.key -out certificate.crt

Figure 3: Generate .crt file with OpenSSL

Below is a description of each command and option.

Your .CRT file will be saved in the current working directory, except you specified a different path.

Conclusion

Following this guide, you should now create a .CRT file by using the OpenSSL tool. Technically, this is a self-signed certificate and should be for internal use or testing and development purposes. Major web browsers do not have confidence in self-signed certificates.

Control & manage mouse movement between multiple monitors in Windows 10
Dual Display Mouse Manager lets you control & configure mouse movement between multiple monitors, by slowing down its movements near the border. Windo...
WinMouse lets you customize & improve mouse pointer movement on Windows PC
If you want to improve the default functions of your mouse pointer use freeware WinMouse. It adds more features to help you get the most out of your h...
Mouse left-click button not working on Windows 10
If you are using a dedicated mouse with your laptop, or desktop computer but the mouse left-click button is not working on Windows 10/8/7 for some rea...