Back to commands

Linux Survival Basics

Read-only

Show HTTPS Certificate with curl

You need client-visible TLS certificate details during an HTTPS request.

Command

curl -Iv https://example.com/ 2>&1 | sed -n "/SSL connection/,/expire date/p"

Before you run this

System impact: Read-only. Low when scoped to the shown target.

When not to use it: Do not treat this as a substitute for checking the server block and certificate files.

Expected output

TLS handshake, subject, issuer, and expiry lines from curl verbose output.

System impact

Read-only. Nothing changes. The command reads current state and prints diagnostic evidence.

Recovery / rollback: no state is changed.

When to use it

Use when browser and server assumptions disagree.

When not to use it

Do not treat this as a substitute for checking the server block and certificate files.

Common misread

Do not treat this as a substitute for checking the server block and certificate files.

Example run

Commands shown

These are the commands shown for inspection. Treat them as an example, not proof that your system will behave identically.

  1. curl -Iv https://example.com/ 2>&1 | sed -n "/SSL connection/,/expire date/p"
  2. curl -Iv https://example.com/ 2>&1 | sed -n "/SSL connection/,/expire date/p"

next steps

Related commands

Linux Survival Basics Sensitive output

Read TLS Certificate Subject and Issuer

The certificate can be valid but issued for the wrong name.

openssl s_client -connect example.com:443 -servername example.com </dev/null 2>/dev/null | openssl x509 -noout -subject -issuer -dates
Linux Survival Basics Sensitive output

Show Served Certificate SANs

SANs decide which hostnames the certificate covers.

openssl s_client -connect example.com:443 -servername example.com </dev/null 2>/dev/null | openssl x509 -noout -ext subjectAltName
Linux Survival Basics Read-only

Show the Real User Cron Jobs

Cron problems often hide behind comments, blank lines, and copied folklore.

crontab -l | sed -n '/^[[:space:]]*#/d;/^[[:space:]]*$/d;p'
Linux Survival Basics Read-only

Check Domain A Records

A renewal can fail because DNS points elsewhere.

dig +short example.com A
Linux Survival Basics Sensitive output

Run SSH Verbose Auth Test

Verbose SSH shows which key was offered.

ssh -vvv -o IdentitiesOnly=yes -i ~/.ssh/id_ed25519 user@example.com

next diagnostic step

Where to go from this command

Study mapping

Use this as independent command practice: read the notes, predict the output, then compare it with the example before using a real shell.

  • LPIC-1 style command-line practice
  • LFCS style performance-task practice
  • Linux+ style troubleshooting review

Independent study support only. No affiliation, endorsement, exam dumps, or real exam questions.