Sh1sum

From Wsms

Jump to: navigation, search

Note: This page should be titled sh1sum (all lowercase). It is Sh1sum due to technical limitations of Mediawiki.

sh1sum computes a checksum sum. If the sh1sum checksum of two different files match, you can be almost certain that the files have the same contents. sh1sum is preferable the older md5sum because it produces many order of magnitude more possible checksums.

common usage

Verify that a fedora dvd has downloaded correctly.

Import Fedora's GPG key:

$ wget https://fedoraproject.org/static/fedora.gpg
$ gpg --import fedora.gpg

Now, to verify that the SHA1SUM file is valid, make sure that it has a good signature from the key ID 4F2A6FD2.

$ gpg --verify SHA1SUM

Finally, now that the SHA1SUM file has been verified, check that the ISO's checksum matches:

$ sha1sum -c SHA1SUM

If the output states that the file is valid, you're good to go!

Write the DVD with k3b or a similar program. Then, verify that a CD or DVD-ROM was written correctly. Programs like k3b that write the CD often add padding bytes. The trick is to compare the bytes without padding by using only the length of the original iso image obtained using ls -l. Sometimes you need to be to read the dev files, hence the sudo.

ggeller@roosevelt:~/tmp/Fedora-9-i386-DVD$ sudo dd if=/dev/scd0 | head -c 3580680192 | sha1sum

see also

md5sum
man sh1sum
http://fedoraproject.org/en/verify
Linux_commands

Personal tools