linux运维安全工具集合[持续更新中..]
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实现文件备份同步
常见加固,根据需要调整,转自网友的设置方案http://www.2cto.com/Article/201111/111131.html
http://www.codexiu.cn/linux/blog/5654/
Linux运维shell脚本http://git.oschina.net/MickeyZZC/MLSBS
以下安全加固仅供参考
#!/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运维安全工具集合[持续更新中..]的更多相关文章
- git使用技巧集合(持续更新中)
git使用技巧集合(持续更新中) 在团队协作中,git.svn等工具是非常重要的,在此只记录一些git使用过程中遇到的问题以及解决方法,并且会持续更新. 1.git commit之后,还没push,如 ...
- CNUTCon2017全球运维技术大会(持续更新中) - 斯达克学院 - 实战驱动的 IT 教育平台 - Powered By EduSoho
CNUTCon2017全球运维技术大会(持续更新中) - 斯达克学院 - 实战驱动的 IT 教育平台 - Powered By EduSoho https://new.stuq.org/cours ...
- Linux常用命令及工具记录(持续更新)
一.命令 convmv 作用:文件名的编码转换 安装:sudo apt-get install convmv 使用:convmv * -f gbk -t utf8 --notest c ...
- Linux软件开发常用的软件包(持续更新中)
下面是Linux开发常用的软件包: 软件包的名称 作用描述 安装方式 build-essential sudo apt-get install build-essential policycore ...
- Java基础——集合(持续更新中)
集合框架 Java.util.Collection Collection接口中的共性功能 1,添加 booblean add(Object obj); 往该集合中添加元素,一次添加一个 boolea ...
- linux系统及服务安全(持续更新中)
linux安全 1.隐藏NGINX和PHP版本号 curl -I "http://www.xxx.com" //检测 nginx: http段加入server_tokens of ...
- php 常用函数集合(持续更新中...)
php 常用函数集合 在php的开发中,巧妙的运用php自带的一些函数,会起到事半功倍的效果,在此,主要记录一些常用的函数 1.time(),microtime()函数 time():获取当前时间戳 ...
- linux下 GUI 数码相册项目 持续更新中
GITHUB: https://github.com/nejidev/digital_photo_album 本项目,是部分参考别人的项目,是全新从0编写的.算法实现和别人肯定是不同的,github ...
- Linux系统编程重要细节记录(持续更新中)
1.在打印rlim_t值时,需要将其转换为long long并使用%lld printf()修饰符.
随机推荐
- jinja2 宏的简单使用总结(macro)
Table of Contents 1. 简介 2. 用法 3. 参数和变量 4. 注意事项 4.1. macro的变量只能为如下三种: 4.2. 和block的关系: 5. 参考文档 1 简介 ji ...
- Poco之ftp获取文件列表以及下载文件
#include <iostream>#include <string>#include <vector>#include <algorithm>#in ...
- Flume用来收集日志,zeppelin用来展示
Flume:Flume是一个分布式,可依赖的,用于高效率的收集.聚类.移动大量数据的服务.Flume使用基于流数据的简单而且可扩展的架构.由于拥有可调的依赖机制和许多故障恢复机制,Flume是健壮而且 ...
- iOS 推荐博客
著作权归作者所有.商业转载请联系作者获得授权,非商业转载请注明出处.作者:Franz Fang链接:http://www.zhihu.com/question/20264108/answer/3026 ...
- iOS 图片填充 UIImageView
UIViewContentModeScaleAspectFit, //这个图片都会在view里面显示,并且比例不变 这就是说 如果图片和view的比例不一样 就会有留白如下图1 UIView ...
- iOS 静态库中使用宏定义区分iPhone模拟器与真机---备用
问题描述 一般项目中,可以使用宏定义来判断模拟器还是真机,这无疑是有效的. #if TARGET_IPHONE_SIMULATOR #define SIMULATOR 1 #elif TARGET_O ...
- 关于Java(JDBC介绍)
JDBC API 允许用户访问任何形式的表格数据,尤其是存储在关系数据库中的. JDBC 简单功能 连接数据源,如数据库 传给数据库查询和更新指令 获取并处理数据库返回结果(对查询等的响应) 示例代码 ...
- 第 2 章 代理模式【Proxy Pattern】
第 2 章 代理模式[Proxy Pattern] 以下内容出自:24种设计模式介绍与6大设计原则.pdf 什么是代理模式呢?我很忙,忙的没空理你,那你要找我呢就先找我的代理人吧,那代理人总要知道被代 ...
- 【HDU 5381】 The sum of gcd (子区间的xx和,离线)
[题目] The sum of gcd Problem Description You have an array A,the length of A is nLet f(l,r)=∑ri=l∑rj= ...
- android 对象传输及parcel机制
在开发中不少要用到Activity直接传输对象,下面我们来看看,其实跟java里面差不多 自定义对象的传递:通过intent传递自定义对象的方法有两个 第一是实现Serialization接口: ...