婷婷综合国产,91蜜桃婷婷狠狠久久综合9色 ,九九九九九精品,国产综合av

主頁 > 知識庫 > linux服務器安全加固shell腳本代碼

linux服務器安全加固shell腳本代碼

熱門標簽:地圖標注員都是年輕人 百度地圖標注錯了有責任嗎 揭陽智能電話機器人推薦 江蘇云電銷機器人公司 客服外呼系統怎么樣 河南信譽好的不封卡電話外呼系統 打電話機器人接我是他的秘書 華鋒e路航港口地圖標注 如果做線上地圖標注
復制代碼 代碼如下:

#!/bin/sh
# desc: setup linux system security
# author:coralzd
# powered by www.freebsdsystem.org
# version 0.1.2 written by 2011.05.03
#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 3 ,passwd unlock time 5 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 onerr=fail deny=3 unlock_time=300#' /etc/pam.d/system-auth
# system timeout 5 minite auto logout
echo "TMOUT=300" >>/etc/profile

# will system save history command list to 10
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 700 /bin/ping
chmod 700 /usr/bin/finger
chmod 700 /usr/bin/who
chmod 700 /usr/bin/w
chmod 700 /usr/bin/locate
chmod 700 /usr/bin/whereis
chmod 700 /sbin/ifconfig
chmod 700 /usr/bin/pico
chmod 700 /bin/vi
chmod 700 /usr/bin/which
chmod 700 /usr/bin/gcc
chmod 700 /usr/bin/make
chmod 700 /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
您可能感興趣的文章:
  • 教你如何搭建一個安全的Linux服務器教程
  • Linux VPS安全設置之一 修改SSH端口(CentOS/Debian)
  • linux服務器基本安全配置手冊
  • Linux下Nginx安全證書ssl配置方法
  • Linux SSH 安全策略 更改 SSH 端口
  • 服務器安全狗Linux版軟件安裝使用說明
  • linux服務器下PHPCMS v9 安全配置詳解
  • Linux 服務器安全配置
  • 阿里云linux服務器上使用iptables設置安全策略的方法
  • Linux服務器下nginx的安全配置詳解
  • linux Apache服務器系統安全設置與優化
  • Red Hat Linux 安全設置方法
  • centos 5.1下的安全設置(適合所有的linux版本)
  • Linux VPS安全設置之二 禁用ROOT賬戶
  • Linux SSH 安全策略 限制 IP 登錄方法
  • 安全檢測Unix和Linux服務器安全設置入門精講
  • Linux下的Apache與PHP安全設置技巧
  • Linux/CentOS服務器安全配置通用指南

標簽:婁底 邵陽 巴彥淖爾 許昌 馬鞍山 金昌 淘寶邀評 赤峰

巨人網絡通訊聲明:本文標題《linux服務器安全加固shell腳本代碼》,本文關鍵詞  linux,服務器,安全,加固,;如發現本文內容存在版權問題,煩請提供相關信息告之我們,我們將及時溝通與處理。本站內容系統采集于網絡,涉及言論、版權與本站無關。
  • 相關文章
  • 下面列出與本文章《linux服務器安全加固shell腳本代碼》相關的同類信息!
  • 本頁收集關于linux服務器安全加固shell腳本代碼的相關信息資訊供網民參考!
  • 推薦文章
    主站蜘蛛池模板: 霍州市| 安乡县| 昌江| 鸡东县| 沅陵县| 海林市| 平果县| 鲁甸县| 龙山县| 绥芬河市| 临沂市| 四子王旗| 万荣县| 花莲市| 浠水县| 曲麻莱县| 雅安市| 山西省| 章丘市| 弥勒县| 堆龙德庆县| 镇平县| 蒙山县| 修文县| 双流县| 乌苏市| 盐池县| 桐乡市| 五河县| 秦安县| 洪江市| 澄江县| 徐州市| 新蔡县| 综艺| 中宁县| 通渭县| 崇左市| 三原县| 南汇区| 香港 |