原文来源 :Linux就该这么学
[[email protected] ~]#yum -y install libpcap-devel ncurses-devel
[[email protected] ~]# tar zxvf nethogs-0.8.0.tar.gz
[[email protected] ~]# cd nethogs
[[email protected] nethogs]# make && make install
[[email protected] nethogs]# nethogs eth0
[[email protected] current]# tar xvf iozone3_420.tar
[[email protected] ~]# cd iozone3_420/src/current/
[[email protected] current]# make linux
[[email protected] current]# ./iozone -a -n 512m -g 16g -i 0 -i 1 -i 5 -f /mnt/iozone -Rb ./iozone.xls
-a使用全自动模式 -n为自动模式设置最小文件大小(Kbytes)。 -g设置自动模式可使用的最大文件大小Kbytes。 -i用来指定运行哪个测试。 -f指定测试文件的名字完成后自动删除 -R产生Excel到标准输出 -b指定输出到指定文件上
[[email protected] ~]# yum -y install iotop
[[email protected] ~]# yum -y install iptraf
[[email protected] ~]# tar zxvf iftop-0.17.tar.gz
[[email protected] ~]# cd iftop-0.17 [[email protected] iftop-0.17]# ./configure
[[email protected] iftop-0.17]# make && make install
[[email protected] iftop-0.17]# iftop [[email protected] iftop-0.17]# iftop -i eth0 #指定监控网卡接口
[[email protected] ~]# yum -y install htop
[[email protected] ~]# chmod +x nmon_x86_64_rhel6
[[email protected] ~]# mv nmon_x86_64_rhel6 /usr/sbin/nmon
[[email protected] ~]# nmon
[[email protected] ~]# yum -y install multitail
[[email protected] ~]# multitail -e "fail" /var/log/secure #筛选关键字进行监控
[[email protected] ~]# multitail -l "ping baidu.com" #监控后面的命令-l将要执行的命令
[[email protected] ~]# multitail -i /var/log/messages -i /var/log/secure #-i指定一个文件名
[[email protected] ~]# cd fail2ban-0.8.11
[[email protected] fail2ban-0.8.11]# python setup.py install
[[email protected] fail2ban-0.8.11]# cd files/
[[email protected] files]# cp ./redhat-initd /etc/init.d/fail2ban
[[email protected] files]# service fail2ban start
[[email protected] files]# chkconfig --add fail2ban
[[email protected] files]# chkconfig fail2ban on
[[email protected] ~]# grep -v "^#" /etc/fail2ban/jail.conf | grep -v "^$" [DEFAULT]
ignoreip = 127.0.0.1/8#忽略本机IP
bantime = 600 #符合规则后封锁时间
findtime = 600 #在多长时间内符合规则执行封锁如600秒达到3次则执行
maxretry = 3 #最大尝试次数
backend = auto #日志修改检测日志gamin、polling和auto这三种
usedns = warn [ssh-iptables]
enabled = true#默认是禁用
false filter = sshd action = iptables[name=SSH, port=ssh, protocol=tcp] # sendmail-whois[name=SSH,dest=收件人邮箱, sender=发件人邮箱, sendername="Fail2Ban"] logpath = /var/log/sshd.log #响应的错误日志一般在/var/log/secure maxretry = 5 #尝试错误次数覆盖全局中的maxretry
[[email protected] ~]# touch /var/log/sshd.log
[[email protected] ~]# service fail2ban restart
[[email protected] ~]# fail2ban-client status #查看监控已经开启 Status |- Number of jail: 1 `- Jail list: ssh-iptables
[[email protected] ~]# iptables -L #iptables过滤表有fail2ban一条规则 fail2ban-SSH tcp -- anywhere anywhere tcp dpt:ssh
[[email protected] ~]# tar zxvf agedu-r9723.tar.gz
[[email protected] ~]# cd agedu-r9723
[[email protected] ~]# ./configure
[[email protected] ~]# make && make install
[[email protected] ~]# agedu -s / #-s扫描
[[email protected] ~]# agedu -w --address 192.168.0.10:80 #-w输入一个网页链接
[[email protected] ~]# agedu -w --address 192.168.0.108080 --auth none #--auth关闭认证如果不加端口号会生成一个随机的用浏览器访问
[[email protected] ~]# tar jxvf nmap-6.40.tar.bz2
[[email protected] nmap-6.40]# ./configure
[[email protected] nmap-6.40]# make && make install
[[email protected] ~]# nmap 192.168.0.10 #获取基本信息
[[email protected] ~]# nmap -O 192.168.0.10 #获取系统版本信息
[[email protected] ~]# nmap -A 192.168.0.10 #获取系统综合信息
[[email protected] ~]# nmap 192.168.0.0/24 #获取一个网段工作设备基本信息
-sSTCP扫描 -sV系统版本检测
[[email protected] ~]# tar zxvf httperf-0.9.0.tar.gz
[[email protected] ~]# cd httperf-0.9.0
[[email protected] httperf-0.9.0]# ./configure
[[email protected] httperf-0.9.0]# make && make install
[[email protected] ~]# httperf --hog --server=192.168.0.202 --uri=/index.html --num-conns=10000 --wsess=10,10,0.1
侵权请私聊公众号删文