lynis 安全漏洞检测工具    https://cisofy.com/download/lynis/    https://cisofy.com/files/lynis-2.2.0.tar.gz

命令 :sudo ./lynis --check-all -Q

sudo grep Warning /var/log/lynis.log

sudo grep Suggestion /var/log/lynis.log

   sudo vi /etc/cron.daily/scan.sh

  #!/bin/shAUDITOR="automated"DATE=$(date +%Y%m%d)HOST=$(hostname)LOG_DIR="/var/log/lynis"REPORT="$LOG_DIR/report-${HOST}.${DATE}"DATA="$LOG_DIR/report-data-${HOST}.${DATE}.txt"cd /opt/lynis./lynis -c --auditor "${AUDITOR}" --cronjob > ${REPORT}mv /var/log/lynis-report.dat ${DATA}

            sudo chmod 755 /etc/cron.daily/scan.sh

Linux系统被入侵后的经历 http://lizhenliang.blog.51cto.com/7876557/1769028

阿里云服务器安全配置:http://www.centoscn.com/CentosSecurity/CentosSafe/2015/0713/5855.html

linux服务器集群防火墙搭建 http://www.bubuko.com/infodetail-536557.html

linux企业防火墙搭建 http://www.open-open.com/doc/view/ce393775b65644319174e3dd14e4d305

Linux防火墙生成器技术 http://www.2cto.com/Article/200802/24102.html

Linux下安全扫描工具Nmap用法详解  https://nmap.org/download.html

linux 下各种指标监控 http://www.open-open.com/lib/view/open1392684857866.html

databse 管理 http://dba.stackexchange.com/?tags=mysql

Linux shell脚本 http://blog.csdn.net/su1216/article/details/10586903

Linux反入侵监测工具 http://netsecurity.51cto.com/art/201509/490966.htm   https://suricata-ids.org/download/

Linux后门木马监测工具 http://blog.jobbole.com/77663/

Linux下75款安全工具 http://www.91linux.com/html/2014/Linux_Server_0219/8675.html

Linux服务器安全设置http://0101x.blog.51cto.com/8639108/1365721

Linux系统加固个人经验 http://www.centoscn.com/CentosSecurity/CentosSafe/2015/0315/4881.html

Linux系统加固最佳实践 http://blog.chinaunix.net/uid-25723371-id-4542221.html

Linux web基本模块安装shell整理 https://github.com/oscm/shell      https://github.com/qrpike/CentOS-6-Quick-Install-Scripts

Linux Os系统管理 https://github.com/oscm/shell/tree/master/os

Linux 双机负载均衡配置keepalived+tenginer http://www.it165.net/admin/html/201309/1866.html

Linux rsync增量传输大文件优化技巧

Linux 使用rsync实现文件备份同步

Linux系统初始化优化Shell脚本

常见加固,根据需要调整,转自网友的设置方案http://www.2cto.com/Article/201111/111131.html

http://www.codexiu.cn/linux/blog/5654/

Linux运维shell脚本http://git.oschina.net/MickeyZZC/MLSBS

运维自动化管理服务器 CheungSSH

以下安全加固仅供参考

    #!/bin/sh
# desc: setup linux system security
# author:coralzd
# powered by www.freebsdsystem.org
# version 0.1. written by 2011.05.
#account setup
passwd -l xfs
passwd -l news
passwd -l nscd
passwd -l dbus
passwd -l vcsa
passwd -l games
passwd -l nobody
passwd -l avahi
passwd -l haldaemon
passwd -l gopher
passwd -l ftp
passwd -l mailnull
passwd -l pcap
passwd -l mail
passwd -l shutdown
passwd -l halt
passwd -l uucp
passwd -l operator
passwd -l sync
passwd -l adm
passwd -l lp
# chattr /etc/passwd /etc/shadow
chattr +i /etc/passwd
chattr +i /etc/shadow
chattr +i /etc/group
chattr +i /etc/gshadow
# add continue input failure ,passwd unlock time minite
sed -i 's#auth required pam_env.so#auth required pam_env.so\nauth required pam_tally.so onerr=fail deny=3 unlock_time=300\nauth required /lib/security/$ISA/pam_tally.so nerr=fail deny=3 unlock_time=300#' /etc/pam.d/system-auth
# system timeout minite auto logout
echo "TMOUT=300" >>/etc/profile
# will system save history command list to
sed -i "s/HISTSIZE=1000/HISTSIZE=10/" /etc/profile
# enable /etc/profile go!
source /etc/profile
# add syncookie enable /etc/sysctl.conf
echo "net.ipv4.tcp_syncookies=1" >> /etc/sysctl.conf
sysctl -p # exec sysctl.conf enable
# optimizer sshd_config
sed -i "s/#MaxAuthTries 6/MaxAuthTries 6/" /etc/ssh/sshd_config
sed -i "s/#UseDNS yes/UseDNS no/" /etc/ssh/sshd_config
# limit chmod important commands
chmod /bin/ping
chmod /usr/bin/finger
chmod /usr/bin/who
chmod /usr/bin/w
chmod /usr/bin/locate
chmod /usr/bin/whereis
chmod /sbin/ifconfig
chmod /usr/bin/pico
chmod /bin/vi
chmod /usr/bin/which
chmod /usr/bin/gcc
chmod /usr/bin/make
chmod /bin/rpm
# history security
chattr +a /root/.bash_history
chattr +i /root/.bash_history
# write important command md5
cat > list << "EOF" &&
/bin/ping
/bin/finger
/usr/bin/who
/usr/bin/w
/usr/bin/locate
/usr/bin/whereis
/sbin/ifconfig
/bin/pico
/bin/vi
/usr/bin/vim
/usr/bin/which
/usr/bin/gcc
/usr/bin/make
/bin/rpm
EOF
for i in `cat list`
do
if [ ! -x $i ];then
echo "$i not found,no md5sum!"
else
md5sum $i >> /var/log/`hostname`.log
fi
done
rm -f list
#!/bin/sh

echo "00 */1 * * *  /usr/sbin/ntpdate 192.168.1.1 >>/var/log/ntpdate.log" > mycrontab

crontab  mycrontab

rm -rf mycrontab

/usr/sbin/ntpdate 192.168.1.1

cp  /etc/sysconfig/i18n  /etc/sysconfig/i18n.bak

echo >  /etc/sysconfig/i18n

echo LANG="zh_CN.GB18030" >> /etc/sysconfig/i18n 

echo LANGUAGE="zh_CN.GB18030:zh_CN.GB2312:zh_CN" >> /etc/sysconfig/i18n 

echo SUPPORTED="zh_CN.UTF-8:zh_CN:zh:en_US.UTF-8:en_US:en" >> /etc/sysconfig/i18n 

echo SYSFONT="latarcyrheb-sun16"  >> /etc/sysconfig/i18n 

#echo "root:xbbwlcUoKjF7" | chpasswd

useradd weblogic

echo "weblogic:weblogic" | chpasswd

history -c 

# 接收套接字缓冲区大小的缺省值

echo "net.core.rmem_default = 2569600" >>/etc/sysctl.conf

# 最大的TCP数据接收缓冲

echo "net.core.rmem_max = 2569600" >>/etc/sysctl.conf

# 发送套接字缓冲区大小的缺省值

echo "net.core.wmem_default = 2569600" >>/etc/sysctl.conf

# 最大的TCP数据发送缓冲

echo "net.core.wmem_max = 2569600" >>/etc/sysctl.conf

# 时间戳在(请参考RFC )TCP的包头增加12个字节

echo "net.ipv4.tcp_timestamps = 0" >>/etc/sysctl.conf

# 有选择的应答

echo "net.ipv4.tcp_sack = 1" >>/etc/sysctl.conf

# 支持更大的TCP窗口. 如果TCP窗口最大超过65535(64K), 必须设置该数值为1 

echo "net.ipv4.tcp_window_scaling = 1" >>/etc/sysctl.conf

# 开启keepalive的闲置时长

echo "net.ipv4.tcp_keepalive_time = 600" >>/etc/sysctl.conf

echo "kernel.sem = 500 64000 200 256" >>/etc/sysctl.conf

# 文件句柄

echo "fs.file-max = 65536" >>/etc/sysctl.conf

echo "net.ipv4.ip_local_port_range = 1024 65000" >>/etc/sysctl.conf

# 当本地系统向外发起tcp或udp连接请求时使用的端口范围

sysctl -p

cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak

sed -i "s/#PermitRootLogin yes/PermitRootLogin no/" /etc/ssh/sshd_config

#当普通用户登录时,密码输入错误三次,系统马上把该用户锁定,需要120s后重新登录

cp /etc/pam.d/system-auth /etc/pam.d/system-auth.bak

#auth required pam_tally2.so deny= onerr=fail no_magic_root unlock_time=

#由于远程是可以通过普通用户登录,所以普通用户的密码复杂度必须设置:给所有普通用户设置密码时,至少有一个特殊字符、大写字母、小写字母、最小长度为8位

#password requisite /lib/security/$ISA/pam_cracklib.so retry= difok=  ocredit=- dcredit=- ucredit=-  minlen=

#设置密码过期的时间最多天数,新建用户是,用户可以修改的天使,密码的最短长度(前面已经设置可以不设置),密码过期的警告天数。

cp /etc/login.defs /etc/login.defs.bak

sed -i 's/PASS_MAX_DAYS.*   99999/PASS_MAX_DAYS   90/' /etc/login.defs 

sed -i 's/PASS_MIN_DAYS.*   0/PASS_MIN_DAYS   7/' /etc/login.defs 

sed -i 's/PASS_MIN_LEN.*    5/PASS_MIN_LEN    8/' /etc/login.defs 

#关闭DNS

cp  /etc/resolv.conf /etc/resolv.conf.bak

echo 'nameserver 210.22.84.3' > /etc/resolv.conf

#备份环境变量文件

cp  /etc/profile /etc/profile.bak

echo export TMOUT= >> /etc/profile  #增加60S超时退出

echo export HISTTIMEFORMAT=\'%F %T \' >> /etc/profile    #记录操作历史记录的时间

echo export HISTFILESIZE= >> /etc/profile

echo export HISTSIZE= >> /etc/profile

#修改系统文件最大打开数

echo -e "* soft  nofile = 32768 \n* hard  nofile = 65536" >> /etc/security/limits.conf

#计划任务

mkdir ~/Shell

echo -e " #!/bin/bash \n sync \n echo 3 > /proc/sys/vm/drop_caches" > ~/Shell/MemcacheClean.sh

echo "00 03 * * * /Shell/MemcacheClean.sh" > ~/Shell/mycrontab

crontab ~/Shell/mycrontab

#关闭selinux

sed '7s/enforcing/disabled/g' /etc/sysconfig/selinux -i

#关闭火墙

iptables -F

/etc/init.d/iptables save >> /dev/null

service sshd restart 

history -c

Windows系统加固脚本 http://www.wanglinlin.cn/?post=63

小常识收集:

linuxvim格式化代码 格式化全文: gg=G   自动缩进当前行: ==

网站根目录权限遵循:
文件644 文件夹755  权限用户和用户组www
如出现文件权限问题时,请执行下面3条命令:

chown -R www.www /data/wwwroot/

find /data/wwwroot/ -type d -exec chmod 755 {} \;

find /data/wwwroot/ -type f -exec chmod 644 {} \;

linux运维安全工具集合[持续更新中..]的更多相关文章

  1. git使用技巧集合(持续更新中)

    git使用技巧集合(持续更新中) 在团队协作中,git.svn等工具是非常重要的,在此只记录一些git使用过程中遇到的问题以及解决方法,并且会持续更新. 1.git commit之后,还没push,如 ...

  2. CNUTCon2017全球运维技术大会(持续更新中) - 斯达克学院 - 实战驱动的 IT 教育平台 - Powered By EduSoho

    CNUTCon2017全球运维技术大会(持续更新中) - 斯达克学院 - 实战驱动的 IT 教育平台 - Powered By EduSoho   https://new.stuq.org/cours ...

  3. Linux常用命令及工具记录(持续更新)

    一.命令 convmv   作用:文件名的编码转换   安装:sudo apt-get install convmv   使用:convmv * -f gbk -t utf8 --notest   c ...

  4. Linux软件开发常用的软件包(持续更新中)

    下面是Linux开发常用的软件包: 软件包的名称 作用描述 安装方式 build-essential   sudo apt-get install build-essential policycore ...

  5. Java基础——集合(持续更新中)

    集合框架 Java.util.Collection Collection接口中的共性功能 1,添加 booblean add(Object obj);  往该集合中添加元素,一次添加一个 boolea ...

  6. linux系统及服务安全(持续更新中)

    linux安全 1.隐藏NGINX和PHP版本号 curl -I "http://www.xxx.com" //检测 nginx:  http段加入server_tokens of ...

  7. php 常用函数集合(持续更新中...)

    php 常用函数集合 在php的开发中,巧妙的运用php自带的一些函数,会起到事半功倍的效果,在此,主要记录一些常用的函数 1.time(),microtime()函数 time():获取当前时间戳 ...

  8. linux下 GUI 数码相册项目 持续更新中

    GITHUB: https://github.com/nejidev/digital_photo_album 本项目,是部分参考别人的项目,是全新从0编写的.算法实现和别人肯定是不同的,github ...

  9. Linux系统编程重要细节记录(持续更新中)

    1.在打印rlim_t值时,需要将其转换为long long并使用%lld printf()修饰符.

随机推荐

  1. C语言中输入输出格式控制

    1.C语言中,非零值为真,真用1表示:零值为假,假用0表示. 2.转义字符参考: \a 蜂鸣,响铃 \b 回退:向后退一格 \f 换页 \n 换行 \r 回车,光标到本行行首 \t 水平制表 \v 垂 ...

  2. word中几个好用的宏代码(立方米上标、关闭样式自动更新、删除无效样式、表格加粗边框、宋体引号)

    Sub 替换立方米() With Selection.Find .Text = "m3" .Replacement.Text = "mm3" .Forward ...

  3. windows下python 编码问题

    windows下py文件编码: 当print 时遇到unicode 会根据系统编码转换, 而raw_input 中的输出遇到unicode编码是不会的转码的,会报错UnicodeEncodeError ...

  4. python多线程 批量下补丁

    一个一个下载 要2个多小时.就直接起了个线程池.效果明显.import urllib2 from urlparse import urlparse uri = 'http://******/patch ...

  5. Stanford CoreNLP--Named Entities Recognizer(NER)

    Standford Named Entities Recognizer(NER),命名实体识别是信息提取(Information Extraction)的一个子任务,它把文字的原子元素(Atomic ...

  6. 3G 2G GPRS 1G的概念

    3G, 第三代移动通信技术(3rd-generation,3G),是指支持高速数据传输的蜂窝移动通讯技术.3G服务 能够同时传送声音及数据信息,速率一般在几百kbps以上.3G标准:它们分别是WCDM ...

  7. CPU,MPU,MCU,SOC,SOPC联系与差别

    转自CPU,MPU,MCU,SOC,SOPC联系与差别 1.CPU(Central Processing Unit),是一台计算机的运算核心和控制核心.CPU由运算器.控制器和寄存器及实现它们之间联系 ...

  8. 记录一下MYSQL的SQL语法

    这是加时间的语法 update  mylog set  mydate= DATE_ADD( mydate, INTERVAL 13 HOUR) WHERE mydate BETWEEN '2014-0 ...

  9. git rebase实战

    在develop分支上rebase另外一个分支master,是将master作为本地,develop作为远端来处理的. 最后的效果是,develop分支看起来像是在master分支的最新的节点之后才进 ...

  10. USACO3.34Home on the Range(DP)

    之前做过一道类似的 国际象棋盘神马的.. 统计出以每个1作为右下角的最大正方形 那么以大于二到这个最大值之间为边的正方形都可以以这个为右下角 累加就可以了 dp[i][j] = min(dp[i-1] ...