Debian 13 Tutorial / Choose an Installation Image and Verify Its Checksum and Signature

For a Debian 13 minimal-server lab, choose the official stable netinst image for your CPU architecture and verify both its signed checksum list and the ISO hash before installation. The signature identifies the publisher of the checksum list when checked against a trusted key; the SHA-256 comparison checks the downloaded image against that list. This lesson uses a Windows host.

Choose an image for the server lab

An ISO is a file that contains the contents of the installation medium. In VirtualBox, you can connect it to the virtual DVD drive, so there is no need to extract the file or burn it to an actual DVD. However, just being an ISO does not necessarily mean it is suitable for server purposes or matches the architecture.

Image type When to use it What to check
netinst Start with a small base installation image and download additional packages over the network. To install additional software you want, you must be able to access a mirror during the installation.
DVD Image You need more packages available on the installation media. It does not mean that all packages and the latest security updates are included on the media.
Live Image You want to try a desktop environment before installing it. Its screens and installer differ from the netinst procedure used for this minimal-server course.

In this tutorial, we select the amd64 image from the Official Stable netinst Guide. amd64 is a typical 64-bit x86 PC environment and can also be used on Intel CPUs. For ARM computers, do not select the same file; separately check the supported hardware and installation method. If a live environment is needed, select the appropriate option from the Official Live Image Guide.

Distinguish between stable and testing links, and also check that the filename indicates it is for Debian 13. Do not confuse daily development images with the latest official installation image. The criteria for selecting a distribution and release follow the scope explained in Features of Debian 13 and Choosing a Distribution.

Download the verification files with the image

Download SHA256SUMS and SHA256SUMS.sign from the same directory as the selected image. The first file contains the SHA-256 hashes for each image, and the second file is the detached signature for that list. Do not mix them with lists from similarly named other versions or directories for other architectures.

Guide to verifying Debian images explains how to verify using checksums and OpenPGP signatures. OpenPGP is a standard for handling public key signatures, and here we use gpg, the implementation tool GnuPG. If you do not have the tool on Windows, prepare according to Gpg4win official distribution guide, and check in a new terminal to see if gpg --version works. Do not skip verifying the authenticity of the installation file itself.

Do not trust a public key solely because the name or email address is similar. Compare its complete fingerprint with the official reference. The example below targets the Debian CD signing key used for the verification in this text, and if the official guide or actual signer has changed, stop and first investigate the changes.

DF9B 9C49 EAA9 2984 3258 9D76 DA87 E80D 6294 BE9B

This key is the CD signing key for the installation image. Do not confuse it with the archive key used to verify APT repositories after installation. There is also no need to arbitrarily raise the ownertrust value of the key to bypass trust warnings.

Prepare a dedicated download folder in Windows PowerShell

Run in a regular user PowerShell. Administrator privileges or disk formatting are not required. GnuPG must be ready, and you should also check that there is enough free space to download the files. The worked example uses the verified file debian-13.7.0-amd64-netinst.iso. If a different 13.x version is provided on the official page, check the file name along with the corresponding distribution directory and change accordingly. current does not always point to the same version.

$ErrorActionPreference = 'Stop'
$mediaDir = Join-Path (Get-Location) 'debian13-media'
if (Test-Path -LiteralPath $mediaDir) {
    throw 'Directory already exists. Inspect it or choose a new path.'
}
New-Item -ItemType Directory -Path $mediaDir | Out-Null
Set-Location -LiteralPath $mediaDir

$isoName = 'debian-13.7.0-amd64-netinst.iso'
$baseUrl = 'https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/'
foreach ($fileName in @($isoName, 'SHA256SUMS', 'SHA256SUMS.sign')) {
    Invoke-WebRequest -Uri ($baseUrl + $fileName) -OutFile $fileName
}
Invoke-WebRequest -Uri 'https://www.debian.org/CD/key-DA87E80D6294BE9B.txt' -OutFile 'debian-cd-signing-key.asc'
Get-ChildItem -File | Select-Object Name, Length

Check the list for ISO, checksum, signature, and public key files. If you need to download again, first inspect the storage location and any partially downloaded files. At this step, merely having downloaded the files does not complete verification.

First verify the fingerprint and the signature of the checksum files

From the folder you downloaded, run the block below. To avoid changing your personal key storage, create a separate verify-keyring folder and convert the public key file into a binary keyring for verification. If a folder with this name already exists, do not automatically delete it; start by checking the previous verification status. The command below uses only the previously obtained public key file and does not automatically fetch keys from the network.

$ErrorActionPreference = 'Stop'
$expectedFingerprint = 'DF9B9C49EAA9298432589D76DA87E80D6294BE9B'
$keyHome = './verify-keyring'
if (Test-Path -LiteralPath $keyHome) { throw 'Inspect the existing verification keyring first.' }
New-Item -ItemType Directory -Path $keyHome | Out-Null

$keyInfo = & gpg --homedir $keyHome --batch --with-colons --show-keys 'debian-cd-signing-key.asc'
if ($LASTEXITCODE -ne 0) { throw 'Could not read the public key.' }
$fingerprintLine = $keyInfo | Where-Object { $_.StartsWith('fpr:') } | Select-Object -First 1
if (-not $fingerprintLine) { throw 'Public-key fingerprint is missing.' }
$fingerprint = ($fingerprintLine -split ':')[9]
if ($fingerprint -ne $expectedFingerprint) { throw 'Key fingerprint differs from the official reference.' }

& gpg --homedir $keyHome --batch --dearmor --output './verify-keyring/debian-cd.gpg' 'debian-cd-signing-key.asc'
if ($LASTEXITCODE -ne 0) { throw 'Could not create the verification keyring.' }
$signatureStatus = & gpg --homedir $keyHome --batch --no-default-keyring --keyring './verify-keyring/debian-cd.gpg' --status-fd 1 --verify 'SHA256SUMS.sign' 'SHA256SUMS'
if ($LASTEXITCODE -ne 0) { throw 'Checksum-list signature verification failed.' }
$validSignature = $signatureStatus | Where-Object {
    $_ -match ('^\[GNUPG:\] VALIDSIG ' + $expectedFingerprint + ' ')
}
if (-not $validSignature) { throw 'No valid signature from the expected signer.' }
'Signature verification passed'

Do not just look at the phrase Good signature; also check the exit code and the fingerprint of VALIDSIG. A warning may appear stating that the trust level of the key owner has not been set separately, but that is different from an error indicating the signature is broken. The example restricts verification to the downloaded key after directly matching its complete fingerprint against the official reference. Do not use the ISO for installation if BAD signature, an unexpected signer, or a read error occurs.

Select the exact ISO filename and compare SHA-256

Find the entry of the ISO selected from the list that passed signature verification and compare it with the hash of the local file. The list may include images for purposes other than the standard netinst. Do not search using only part of the filename and select the first line; compare the entire filename.

$isoName = 'debian-13.7.0-amd64-netinst.iso'
$rows = @(Get-Content -LiteralPath 'SHA256SUMS' | ForEach-Object {
    $fields = $_ -split '\s+', 2
    if ($fields.Count -eq 2 -and $fields[1].TrimStart('*') -eq $isoName) {
        $fields[0]
    }
})
if ($rows.Count -ne 1) { throw 'Expected exactly one checksum entry for the selected ISO.' }
$actualHash = (Get-FileHash -LiteralPath $isoName -Algorithm SHA256).Hash
if ($actualHash -ne $rows[0]) { throw 'ISO checksum does not match.' }
'ISO SHA-256 verification passed'

The verification environment for this article was a Windows host, GnuPG 2.4.9, and the corresponding amd64 netinst image. The image size was 792,723,456 bytes, and the signature-verified list matched the SHA-256 below. This value is based on the observation of this file and should not be used for the hash of other point releases.

a7ef94ac2fb9a7fec454552abd629b7cc9d5155c886165a45649f5ce6167e355

If preparing on Debian-based Linux, you can check the same key and signature with GnuPG first and then use sha256sum. The Windows Get-FileHash also calculates the same SHA-256, so there is no need to install a separate Linux VM just to get the hash.

How to distinguish between verification failure and file alteration

Once the verification of the normal file is complete, you can observe a signature failure by changing only the copy of the checksum file while preserving the original. You do not need to copy and modify the entire ISO for this negative test. The command below does not modify the normal SHA256SUMS or ISO.

$changedFile = 'SHA256SUMS.tampered'
if (Test-Path -LiteralPath $changedFile) { throw 'Inspect the existing practice file first.' }
[System.IO.File]::WriteAllBytes(
    (Join-Path (Get-Location) $changedFile),
    [System.IO.File]::ReadAllBytes((Join-Path (Get-Location) 'SHA256SUMS'))
)
Add-Content -LiteralPath $changedFile -Value 'changed'
& gpg --homedir $keyHome --batch --no-default-keyring --keyring './verify-keyring/debian-cd.gpg' --verify 'SHA256SUMS.sign' $changedFile
if ($LASTEXITCODE -eq 0) { throw 'The changed checksum list was incorrectly accepted.' }
'Confirmed that signature verification rejects the changed list.'

In the verification practice, signatures of the normal list passed, and modified copies were rejected. This is a comparison showing that if the checksum list changes, it cannot be verified by the existing signature. It does not test disk formatting or establish that an installed operating system is secure.

Symptoms What to check Response
ISO hash mismatch Interrupted download, different file name, checksum list from a different release Do not use the file in question, verify the combination of the original path and file, and then download it again.
Signature verification failed Check the pair of list and signature files, file modifications, public key, and tool errors Recheck the official distribution materials without ignoring warnings.
Fingerprint does not match expectations Incorrectly received key, actual signer changed, official notice Do not replace just by the key name. First verify the trust basis of the new key.
gpg command not found Installed GnuPG and the execution path of the terminal Check the official installation guide and execution path, then check again in a new terminal.

Files for installation and record keeping

The target to be used for installation is a legitimate ISO that passes both signature and hash verification. If you record the file name, architecture, hash, full signature key fingerprint, and the date of verification, it will be easier to compare the results of the installation later. The above PowerShell example does not modify personal key stores or system settings, and the verification keyring and deliberately changed copy stay inside the dedicated media directory.

When organizing practice materials, check the exact paths and remove only dedicated copies, while keeping the legitimate ISO, verification materials, and records for as long as needed. Connect the legitimate ISO to VirtualBox. Writing to an actual device via USB can erase existing data on the target USB, so it should be treated as a separate process from the download and verification tasks performed here.