[root@10.0.0.10 check]# ssh 10.0.0.20 "uname -a" Linux localhost 2.4.20-8 #1 Thu Mar 13 17:54:28 EST 2003 i686 i686 i386 GNU/Linux |
/etc/passwd /etc/shadow /etc/group |
TGT=$1 LST=/admin/check/file.lst KEEP=/admin/check/$TGT-keep.db rm -rf $KEEP for x in `cat $LST` do ssh $TGT "md5sum $x" >> $KEEP done chmod 600 $LST $KEEP |
[root@10.0.0.10 check]# ./setup 10.0.0.20 [root@10.0.0.10 check]# ls *.db 10.0.0.20-keep.db [root@10.0.0.10 check]# cat 10.0.0.20-keep.db 4f0c9578ca38d2303fa39e98b5550e6b /etc/passwd de83d9e9afa30353188f531cb27fd3f6 /etc/shadow 06cca61eb8946f48f309f23c5de380c4 /etc/group [root@10.0.0.10 check]# |
TGT=$1 LST=/admin/check/file.lst TMP=/tmp/check.lt KEEP=/admin/check/$TGT-keep.db touch $TMP for x in `cat $LST` do ssh $TGT "md5sum $x" >> $TMP done if [ `diff $KEEP $TMP | wc -l` = "0" ] then echo "All seems fine.." else diff $KEEP $TMP fi rm -rf $TMP |
[root@10.0.0.10 check]# ./check 10.0.0.20 All seems fine.. |
[root@10.0.0.10 check]# ./check 10.0.0.20 3c3 < 06cca61eb8946f48f309f23c5de380c4 /etc/group --- > ed1a14ad9174cbeeebd357e49aa84f47 /etc/group |
[root@10.0.0.10 check]# pwd /admin/check [root@10.0.0.10 check]# ls -l total 16 -rw------- 1 root root 137 Jul 20 13:12 110.0.0.20-keep.db -rwx------ 1 root root 268 Jul 20 12:45 check -rw------- 1 root root 35 Jul 20 12:40 file.lst -rwx------ 1 root root 163 Jul 20 12:46 setup [root@10.0.0.10 check]# |