Batch File md5 value verification in CentOS

Source: Internet
Author: User

Batch File md5 value verification in CentOS

For security purposes, after linux is deployed for the first time, the md5 value of the corresponding directory file is generated, for example, the execution file under the/sbin directory. If the website program file is deployed, you can also generate the md5 value immediately, and record the changes each time. In this way, you can compare the md5 values of files in batches to check whether the files have been maliciously modified.

1. Generate the md5 value of a directory file. Take/sbin as an example.

Find/sbin-typef | xargs md5sum> sbin. md5

2. Use this command again to generate the md5 value during the comparison, and then use the diff command for comparison.

Find/sbin-typef | xargs md5sum> sbin2.md5

[Root @ owncloud ~] # Diff sbin. md5 sbin2.md5

206c206 <d4d94e25f3f600d17aab0ce82505209d/sbin/dmeventd-> a4d94e25f3f600d17aab0ce82505209d/sbin/dmeventd

As you can see, the md5 values of/sbin/dmeventd are different, indicating that the file has been modified by intruders. (I changed the md5 value to display the comparison result)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.