>_ IzzyLab

Hands-on task

This task is step 16 of the course “Linux server security”

GPG: sign a file

medium~5 min

The keyring already contains a private key (IzzyTest). Create a detached signature of the file /root/msg.txt in /root/msg.txt.sig and make sure it verifies.

What you'll practise:
  • gpg
  • detached signature
  • digital signature
  • loopback pinentry
  • integrity verification

Topic breakdown

A digital signature confirms both authorship and data integrity: a private key produces a cryptographic fingerprint that anyone holding the public key can verify. A detached signature is stored as a separate file next to the original, without altering the data itself — handy for distributions and releases. In a non-interactive environment gpg can't ask for a passphrase through the usual pinentry, so a batch mode with loopback passphrase input is used; the signature is verified with the gpg --verify command.

What's checked

  1. detached signature is created and verifies

What it looks like