Sample Header Ad - 728x90

sha256checksum - how to compare local file with checksum of the remote original

0 votes
2 answers
155 views
I have a local file file1 as well as the sha256 checksum of the original file. The remote is a rhel8 server, local tool sha256sum inside of a git bash on a Windows10 Laptop. For the love of god I seem to be unable to compare those too in a reasonable manner. on the remote I get
~> sha256sum file1
55dcd0a7046a24e5ee296d1481d6f787b1956d138bbfb6e44ca8591006367f27  file1
so my question is ... how to I compare that locally created sum with the checksum I took on the remote? I would assume there must be a way to do this with the sha256sum command itself which then somhow outputs checksum matches or checksum differs or is it really that you have to rely on your eysight to compare those 2 or creation of a extra text files containing each checksum and execute a diff on them? the best way I can come up with is
echo [sha of the remote file] ; sha256sum file1
55dcd0a7046a24e5ee296d1481d6f787b1956d138bbfb6e44ca8591006367f27
55dcd0a7046a24e5ee296d1481d6f787b1956d138bbfb6e44ca8591006367f27 *file1
... and then compare those 2 lines using my bare eyesight. is there nothing better? the manual says
-c, --check
              read SHA256 sums from the FILEs and check them
but what does that practically mean? sha256sum file1 --check [sha of the remote file] would sound logical to me but does not work. Neither does
:~> sha256sum file1 --check
sha256sum: file1: no properly formatted SHA256 checksum lines found
Asked by vrms (287 rep)
Oct 28, 2024, 05:52 PM
Last activity: Oct 29, 2024, 10:55 AM