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)