#!/bin/bash
while true;do
awk '/Failed/{ip[$11]++}END{for(i in ip){if(ip[i]>4){system("echo sshd:"i" >> /etc/hosts.deny")}}}' /data/log/sshd.log
sleep 5m
donenginx
[magedu@centos7 ~]$cat /etc/shadow
cat: /etc/shadow: Permission deniedredis一、編輯/etc/sudoers 文件:
[root@centos7 ~]##vim /etc/sudoers
magedu ALL=(root) ALLvim
二、切換magedu用戶,並執行命令:
[root@centos7 ~]#su - magedu
[magedu@centos7 ~]$sudo cat /etc/shadowcentos
架構班的小夥伴做業看這裏哦:tomcat
一、安裝配置zabbix,並實現zabbix監控tomcat,nginx,memcached,redis等,並實現發生報警後發送郵件報警。bash