08 2020 档案
摘要:1、编写脚本/root/bin/checkip.sh,每5分钟检查一次,如果发现通过ssh登录失败 次数超过10次,自动将此远程IP放入Tcp Wrapper的黑名单中予以禁止防问 #! /bin/bash lastb|awk '!/^$|btmp/{ip[$3]++}END{for(i in ip
阅读全文
摘要:1、编写脚本selinux.sh,实现开启或禁用SELinux功能 #!/bin/bashconf="/etc/selinux/config" case "$1" in on) sed -ir 's/SELINUX=.*/SELINUX=enforcing/' $conf;; off) sed -i
阅读全文
摘要:1、编写脚本,接受二个位置参数,magedu和/www,判断系统是否有magedu,如果没有则自动创建magedu用户,并自动设置家目录为/www #!/bin/bash if ! getent passwd $1 > /dev/null then echo `useradd -d $2 $1` f
阅读全文
摘要:1、显示统计占用系统内存最多的进程,并排序。 [root@centos7 ~]# ps -eo pid,ppid,cmd,%mem --sort=-%mem 2、编写脚本,使用for和while分别实现192.168.0.0/24网段内,地址是否能够ping通,若ping通则输出"success!"
阅读全文

浙公网安备 33010602011771号