Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk10 min

How to Generate a CSR Code for an SSL Certificate on Linux

Use OpenSSL on Linux to create a PKCS#10 CSR, add DNS and IP SANs, choose between a new or existing private key, verify the request, and submit only the CSR to your certificate authority.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Generate a Linux certificate signing request (CSR) with OpenSSL, verify it locally, and send only the .csr file to your certificate authority (CA). A typical one-off command is openssl req -new -newkey rsa:2048; for production requests, include every hostname and IP address in the Subject Alternative Name (SAN) extension and inspect the finished request before submission.

What a CSR is—and what it is not

A certificate signing request is a PKCS#10 data structure that asks a CA to issue an SSL/TLS certificate. It contains:

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • The requested subject (distinguished-name fields such as country, organization and common name).
  • The public key that will appear in the eventual certificate.
  • Requested certificate extensions, especially Subject Alternative Name (SAN) entries.
  • A digital signature proving that the requester possesses the corresponding private key.

A CSR is not the issued certificate and it does not contain the private key. The private key stays on the Linux host and must never be uploaded to a CA, pasted into a ticket or sent to a hosting provider unless a documented key-transfer procedure specifically requires it.

OpenSSL’s req command creates and inspects CSRs. The OpenSSL manual describes it as the “PKCS#10 certificate request and certificate generating command.”

#1 Best Overall
Sale
TOZO A1 Wireless Earbuds Bluetooth 5.3 Light Weight in Ear Headphones | IPX5 Waterproof,2 Mics for AI Calls,Immersive Premium Sound Bass Headset with Charging Case,32 EQ via App Black
  • [Ultra-Lightweight Ear Buds Designed for Small Ears] Each earbud weighs only 3.7g and features a compact, ergonomic in-ear design made especially for small ears. Secure, low-profile, and comfortable for workouts, all-day wear or overnight sleeping.The ultra-slim profile sits flush in your ear with no hard edges poking or rubbing, so you can even sleep on your side without discomfort.
  • [Immersive Stereo Sound with TOZO OrigX Technology] TOZO OrigX tuning delivers clear vocals, balanced mids, and natural stereo sound for music, podcasts, and videos.
  • [Long Battery Life for Daily Use] Get up to 7 hours of playtime on a single charge, with up to 32 hours total using the charging case—ideal for workdays, commuting, and extended listening sessions.
  • [Bluetooth 5.3 & Stable Connection] Bluetooth 5.3 provides fast pairing, stable wireless performance, and reduced dropouts as you move around home or office.
  • [Deep Bass with Clear Vocals] High-performance drivers produce punchy bass while keeping vocals clean and detailed for everyday listening.

Prepare Linux and protect the key material

Install and identify OpenSSL

Install the OpenSSL package provided by your Linux distribution, then check the installed release and build options:

openssl version -a

Option names and defaults can differ between OpenSSL releases. If a CA gives you an exact key algorithm, signature, subject or extension requirement, follow that requirement over a generic example.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use a private working directory

Run the commands as the account that will own the key, or as an administrator when the service account requires it. Start with a restrictive umask so newly created files are not readable by other users:

umask 077
mkdir -p ~/certificate-request
cd ~/certificate-request

The private key (for example, example.com.key) should remain confidential and should be backed up through your normal protected-secret process. The CSR (for example, example.com.csr) is normally safe to send to the CA because it contains only the public key and request data.

Choose the CSR method that fits the request

Method Best for Important trade-off
Interactive command A one-off request where an administrator can answer prompts Easy to use, but manual entry can introduce spelling or SAN omissions
Noninteractive -subj and -addext Scripts, automation and a single, short SAN list Repeat the entire command carefully; shell history may expose its contents
Configuration file Several names, IP addresses, repeatable builds or change-controlled operations Requires a correctly selected extension section
New private key Initial issuance, key rotation or any suspected exposure of the old key Services and deployment systems must receive the new key securely
Existing private key Renewal or reissue when organizational policy explicitly permits key reuse Reuses the risk and lifetime history of that key

Option A: create a new key and CSR interactively

For a new 2048-bit RSA key and an interactive CSR, run:

umask 077
openssl req -new -newkey rsa:2048 
  -keyout example.com.key 
  -out example.com.csr

-newkey rsa:2048 generates a new RSA key and implies creation of a new request. OpenSSL then asks for distinguished-name values. Enter the values required by your CA; do not invent organization details merely to fill an optional field.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Sale
Smart Watch for Men Women Compatible with iPhone Samsung Android Phone 1.69 inch Full Touch Screen IP68 Waterproof Bluetooh Fitness Tracker Heart Rate/Sleep Monitor (Black)
  • 【IP68 Waterproof Multifunctinal Smart Watch】Torjalph fitness activity tracker smart watch is IP68 waterproof technology ,you can wear it when swimming,handwashing,it's rain-proof which means that you perform multiple exercise modes outside without worrying about sweat or rain corroding your fitness smart watch,and this watch equipped with a 230 mAh large capacity battery magnetic charging ,and this sports activity tracker watch can be used 5-7 days If fully charged.
  • 【Larger 1.83'' Full Screen Watch & Multi-dial Selection】1.83 inch full HD color touch screen smart watch for men / women provides excellent 240*284 resolution image quality ,This Bluetooth smart watch offers a better touch experience and remarkable immersion and ,more than 200 watch faces for you to choose from App"Da Fit ", you can change the dial style according to your mood to wear keeping the world on your wrist
  • 【Accurate Activity Tracker Smart Watch 】sports watch activity tracker uses sweat and dust resistant breathable silicone strap, our Fitness Tracker Smart Watch for Android iOS Phones supports 12 sports modes,walking,running,bicycle,swimming,badminton,basketball,football,rope skipping. This bluetooth calls smart watch for men women is lightweight and stylish, bringing more convenient and relaxing sports experience while also providing more protection.
  • 【Your 24 Hour Personal Daily Health Monitor】Fitness watch for women men full touch screen IP67 waterproof bluetooth smartwatch for Android iOS Phones with heart rate blood pressure monitor multifunction Andriod smart watch with steps counter sleep monitor sports fitness watch, monitoring blood oxygen saturation allows you to understand your physical condition in real time to track fitness progress ,to know your health status in time.
  • 【More Functions Bluetooth Call Smart Watch】This fitness activity smart watch full screen for iPhone and Android phones includes a bunch of new features including:The bluetooth smart watch can hang up the phone, receive and display WhatsAPP /Text /Facebook /Twitter /Messenger reminder.Support sedentary reminder, alarm clock, stopwatch, timer,weather information,music control, remote camera control compatible with Android 5.0 and above or iOS 9.0 and above smartphones.

Some versions and option combinations encrypt the newly written key by prompting for a passphrase. Encryption protects the key if the file is copied or stolen, but an unattended service must then obtain the passphrase during startup. Store the passphrase separately from the key and test the service’s startup process before a maintenance window.

Ubuntu’s server documentation also shows the equivalent two-stage pattern:

openssl genrsa -des3 -out server.key 2048
openssl req -new -key server.key -out server.csr

The two-stage form is useful when you want to generate, protect and inventory the key before creating the CSR. Both approaches produce a key and a request; the CA receives only the request.

What to enter at the prompts

  • Common Name (CN): use the primary name only; modern certificate hostname validation relies on SAN.
  • Subject Alternative Names: the interactive default prompts do not reliably create SANs, so use -addext or a configuration file when names matter.
  • Organization and locality fields: enter values that match the CA’s validation and policy requirements.
  • Challenge password: leave it empty unless your CA explicitly requires it; it is not a replacement for protecting the private key.

Option B: create a CSR from an existing private key

For a renewal or reissue where key reuse is allowed, create a new request from the existing key:

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
openssl req -new 
  -key example.com.key 
  -out example.com.csr

Reuse the key only when your security policy and the CA’s requirements permit it. Generate a new key instead if the old key may have been exposed, if the host was compromised, or if policy requires periodic key rotation. A new CSR alone does not rotate a key.

Include every hostname and IP address in SAN

List every DNS name and IP address that clients will use. Typical entries might include example.com, www.example.com, an internal service name approved by policy, or an IP address. A certificate for only example.com does not automatically cover www.example.com.

Rank #3
New Bee Guitar Cable 10ft Electric Instrument Bass AMP Cord
  • [Low Noise High Fidelity] New bee guitar cord with 22AWG oxygen-free-copper center conductors provides enhanced signal transfer, the PVC insulation material and the high-density stranded copper double shield provide noise rejection for quiet operation
  • [Ideal for Choice] New bee 1/4 straight and right angle metal connectors, ensures a secure connection in any instrument, pedal, or amp jack. L shape great fro on stage guitar stands
  • [Wide Compatible] Suitable for mixer, power amplifier, microphone, effector, decoder, equalizer, electoronic organ, electric guitar, electric bass and other electronic equipments. Widely used in the installation of smart home, karaoke speaker, professional stage audio, etc
  • [Easy Disassemble] Making incidental repairs quick and easy! Very nice, flexible cable
  • [Dont Hesite to Order] 24 hours customer services and professional technology team are standing by

Wildcards cover one DNS label only. For example, *.example.com can match www.example.com, but not api.eu.example.com and not the bare example.com. Use a wildcard only when the CA and your security policy allow it.

One-line noninteractive command

For a single request with a short, known SAN list:

openssl req -new -newkey rsa:2048 -nodes 
  -keyout example.com.key 
  -out example.com.csr 
  -subj "/C=US/ST=California/L=San Francisco/O=Example Inc/CN=example.com" 
  -addext "subjectAltName = DNS:example.com,DNS:www.example.com"

-subj supplies the distinguished name without prompts. -addext requests the SAN extension directly. Add IP addresses with the IP: form, for example IP:203.0.113.10.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

-nodes (called -noenc in newer OpenSSL documentation) leaves the generated private key unencrypted. That is appropriate only when an unattended service must read the key at boot. Compensate with restrictive file permissions, protected host access and a secrets-management process. Do not choose it simply to avoid entering a passphrase on an interactive terminal.

Because command lines can be saved in shell history or process-audit logs, avoid placing sensitive passphrases in the command. The subject and SAN are not private, but your key and any passphrase are.

Use a configuration file for repeatable or larger requests

A configuration file is easier to review when a certificate covers several names or addresses. Create csr.conf with mode 0600:

[req]
distinguished_name = req_distinguished_name
req_extensions = req_ext
prompt = no

[req_distinguished_name]
C = US
ST = California
L = San Francisco
O = Example Inc
CN = example.com

[req_ext]
subjectAltName = @alt_names

[alt_names]
DNS.1 = example.com
DNS.2 = www.example.com
IP.1 = 203.0.113.10

Then generate the key and request:

umask 077
openssl req -new -newkey rsa:2048 
  -keyout example.com.key 
  -out example.com.csr 
  -config csr.conf

The req command supports -config, -reqexts, -extensions and -addext. The exact extension-section name and whether a CA honors requested extensions can vary by OpenSSL release and CA policy. Always inspect the generated CSR; a configuration file is not proof that the CA will copy every requested extension into the issued certificate.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
BSIMB 15.6" Digital Family Calendar & Chore Chart, No Subscription Fees
  • Digital Family Calendar: BSIMB digital calendar wall touch screen puts an end to your chaotic life. Designed for busy families, the digital calendar keeps you organised and in step with your family. Assign different colours and tasks to each family member to make family scheduling easier and more intuitive.
  • Easy Setup and Auto-Sync: Plug in, connect to WLAN and auto-syn your electric calendar in minutes. Digital wall calendar compatible with Google calendar, iCloud calendar, Outlook calendar, Cozi calendar and Yahoo calendar. Add events directly on the device or through the ecalendar app. Electronic calendar stays current whether you're at work or traveling—no manual updates needed.
  • All-In-One Home Assistant: Smart calendar builds habits and encourage independence with personalised chores. Display daily meal plan to reduce the daily ‘What's for dinner?’ stress. To-do lists keep track of everything you want. Turning chores into valuable achievements with stars and rewards, making life easier and more enjoyable.
  • Manage Anytime Anywhere: BSIMB electronic calendar for family stay connected with the powerful ecalendar app. Access and manage your digital wall calendar anytime, anywhere with free features like stars & rewards, photo screensaver, chore charts, meals plans, to-do lists etc. Electronic planner paid features like Magic Import tailor advanced tools for users with special needs.
  • Stay in Touch with Loved Ones: Share photos or videos from your phone to electronic wall calendar with app, instantly update your life moment, and keep in touch with your family, especially those who are far away; you can also surprise your smart calendar digital wall by sending him a wish card; it's also great for keeping tech-illiterate elders in touch with the youngsters.

Keep configuration changes reviewable

  • Use one numbered DNS. or IP. entry per value.
  • Remove names that should no longer appear on the certificate rather than leaving old aliases “just in case.”
  • Protect the file if it contains internal names or organizational details, even though it does not contain the private key.
  • Record which SAN list was approved so the CSR can be compared with the certificate later.

Key algorithm, size and encryption decisions

The examples use a 2048-bit RSA key because it is widely supported, not because every CA or platform requires it. OpenSSL can generate other key types, but the issuing CA, operating system, web server and organizational policy determine what is accepted. Confirm the permitted algorithm, minimum size, signature algorithm and encoding before generating a production request.

Choose encrypted or unencrypted private-key storage based on the deployment model:

  • Encrypted key: safer if the file is copied, but an administrator or a startup secret mechanism must unlock it.
  • Unencrypted key: convenient for unattended startup, but compromise of the file can immediately enable impersonation until the certificate is revoked or expires.

Whichever option you choose, restrict ownership and permissions. Do not make a key world-readable to solve a service permission error; instead, place the service account in the correct protected group or adjust the directory and file ownership.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Verify the CSR before sending it

Inspect the request and verify its signature in one command:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
openssl req -in example.com.csr -noout -text -verify

A successful verification confirms that the CSR’s signature matches the public key inside the request. In the displayed text, check the following before submission:

  • The subject fields are spelled and capitalized as required.
  • Every required DNS name appears under X509v3 Subject Alternative Name.
  • Every required IP address is present as an IP Address entry, not as a DNS name.
  • The public-key algorithm and size meet the CA and platform policy.
  • The request signature verifies successfully.

Useful focused inspections are:

openssl req -in example.com.csr -noout -subject
openssl req -in example.com.csr -noout -pubkey

A PEM-encoded CSR normally begins with -----BEGIN CERTIFICATE REQUEST----- and ends with the matching -----END CERTIFICATE REQUEST----- line. If the file is binary DER instead, use the appropriate encoding option when inspecting or converting it; do not assume that changing the filename extension changes the format.

Submit the right file to the CA

  1. Open the CA’s current ordering or renewal workflow and confirm its required key type, SAN format and validation method.
  2. Upload or paste the contents of example.com.csr exactly as generated.
  3. Complete domain or organization validation requested by the CA.
  4. Store the issued certificate and chain separately from example.com.key.
  5. Install the certificate and chain on the service that owns the private key, then test the complete TLS connection.

Never send example.com.key. If a provider asks for a private key, stop and verify that you are using the provider’s documented CSR-based workflow; giving a private key to a third party changes the trust model and may violate policy.

Troubleshoot common CSR failures

“Unable to load config info” or missing prompts

The command may be unable to find the distribution’s OpenSSL configuration. Specify the intended configuration explicitly with -config /path/to/openssl.cnf, or avoid prompts by supplying -subj and -addext. Use the path installed by your distribution rather than copying a configuration from an unrelated host.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

SAN is absent from the request

Inspect the CSR rather than the command you intended to run. If SAN is missing, the extension section was not selected or the option was not supported as expected. Regenerate the CSR with a verified -addext argument or a configuration that sets req_extensions and the correct section. Adding SAN to a later certificate cannot repair a CSR that omitted it; create a new request.

The hostname is wrong or incomplete

Compare the requested names with the actual URLs, load-balancer names and service aliases clients use. Regenerate the CSR with the complete SAN list. Remember that a wildcard matches only one label and that a bare domain and its www hostname are separate names.

Permission denied while writing the key or CSR

Use a directory owned by the account running OpenSSL, keep umask 077, and check parent-directory permissions. Do not fix the problem with chmod 777 or a world-readable key. If a service needs access later, grant that service the minimum required read permission after the key is created.

The CA rejects the CSR

Compare the request with the CA’s current issuance rules: key type and size, subject formatting, SAN syntax, prohibited internal names, wildcard policy and signature algorithm. A locally valid CSR can still be unacceptable under a CA’s policy. Correct the input and generate a new CSR; do not edit the CSR text manually.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The service cannot start after installation

Check that the certificate’s public key matches the private key, that the service account can read the key, and that the certificate chain is installed in the format the server expects. If the key is encrypted, confirm that the service has a supported way to obtain its passphrase at startup.

A practical pre-submission checklist

  • OpenSSL: openssl version -a recorded for troubleshooting.
  • Directory: working directory is administrator- or service-owned with restrictive permissions.
  • Private key: stored securely, backed up where appropriate, and never included in the CA submission.
  • Subject: organization and other fields match the CA’s requirements.
  • SAN: every required DNS name and IP address is present and correctly typed.
  • Verification: openssl req -in example.com.csr -noout -text -verify succeeds.
  • Policy: key algorithm, size, encryption choice and wildcard use are approved.
  • Delivery: only the CSR is uploaded or pasted into the CA workflow.

When to regenerate instead of reuse

Generate a fresh key and CSR when the previous private key may have been exposed, when an administrator or vendor who had access is no longer trusted, when policy mandates rotation, or when the certificate needs a materially different SAN set. Reusing a key can simplify renewal, but it does not remove the need to verify the new CSR and it does not correct a compromised key.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.