centos 检查文件是否被串改
时间:2017-06-08 13:20 来源:linux.it.net.cn 作者:IT
如果没安装md5sum工具
yum install isomd5sum
检查文件是否被串改
#!/bin/bash
check_dir="/boot /etc /usr"
for i in $check_dir
do
find $i -type f -exec md5sum {} \; |sort > /server/md5$i.new
diff /server/md5$i.md5 /server/md5$i.new >> /server/log/md5.log
done
(责任编辑:IT)
如果没安装md5sum工具 yum install isomd5sum
检查文件是否被串改 #!/bin/bash check_dir="/boot /etc /usr"
for i in $check_dir do find $i -type f -exec md5sum {} \; |sort > /server/md5$i.new diff /server/md5$i.md5 /server/md5$i.new >> /server/log/md5.log done |