How to Generate and Verify Checksums on Linux

August 25, 2023 / cPanel

In this article, we will discuss the process of creating and verifying checksums on Linux. A checksum (also known as a hash) is an alphanumeric code that represents the content of a file. Its primary purpose is to authenticate the integrity of files obtained from external sources.

Follow the following steps to generate checksums on Linux

  1. Log into your account using SSH.
  2. In the command prompt, input one of the subsequent commands, replacing “filename” with the actual name of the file for which you intend to generate a checksum:
  3. To create an MD5 checksum, input:
    md5sum filename > md5sums.txt
  4. To generate an SHA checksum
  5. To generate a SHA-256 checksum, run the following command:
    Sha256sum filename > sha256sums.txt
  6. To generate the SHA-512 checksum, run the below command:
    sha512sum filename > sha512sums.txt

Follow the steps to verify the checksum on Linux

  1. Log in to your account through SSH.
  2. Based on the algorithm chosen for generating the checksums (MD5 or SHA), input any of the commands provided below into the command line. In these examples, the filenames “md5sums.txt” and “sha512sums.txt” are used. If you’ve saved the checksums in an alternative file, replace the filename accordingly.
  3. Enter the commands
  4. To verify MD5 checksums, enter:
    md5sum -c md5sums.txt
  5. To verify SHA checksums, enter:
    sha512sum -c sha512sums.txt

A matched checksum will show as “OK,” while an unmatched checksum will display as “Failed.”

By following these steps, you can effortlessly create and validate checksums on Linux. We trust you found this article helpful. For further insights into web hosting, be sure to regularly explore our Knowledge Base section.

Leave a Reply

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