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

主頁(yè) > 知識(shí)庫(kù) > 一個(gè)Linux系統(tǒng)安全設(shè)置的Shell腳本的分享(適用CentOS)

一個(gè)Linux系統(tǒng)安全設(shè)置的Shell腳本的分享(適用CentOS)

熱門(mén)標(biāo)簽:如果做線上地圖標(biāo)注 揭陽(yáng)智能電話機(jī)器人推薦 江蘇云電銷(xiāo)機(jī)器人公司 地圖標(biāo)注員都是年輕人 百度地圖標(biāo)注錯(cuò)了有責(zé)任嗎 華鋒e路航港口地圖標(biāo)注 打電話機(jī)器人接我是他的秘書(shū) 客服外呼系統(tǒng)怎么樣 河南信譽(yù)好的不封卡電話外呼系統(tǒng)

我們將常用的系統(tǒng)安全配置制作為一個(gè)shell腳本,只需要在服務(wù)器上運(yùn)行這個(gè)shell腳本即可完成安全設(shè)置。

linux的系統(tǒng)安全設(shè) 置Shell腳本是第二次更新,已經(jīng)大量應(yīng)用在某大型媒體網(wǎng)站體系中,加入了之前沒(méi)有想到的一些安全設(shè)置。使用方法將其復(fù)制,保存為一個(gè)shell文件, 比如security.sh.將其上傳到Linux服務(wù)器上,執(zhí)行sh security.sh,就可以使用該腳本了!

復(fù)制代碼 代碼如下:
#!/bin/sh
# desc: setup linux system security
#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.sonauth required pam_tally.so onerr=fail deny=3 unlock_time=300nauth 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

您可能感興趣的文章:
  • 一鍵配置CentOS iptables防火墻的Shell腳本分享
  • Centos下IP與DNS設(shè)置方法詳解
  • CentOS Linux服務(wù)器安全設(shè)置
  • CentOS6.5設(shè)置Django開(kāi)發(fā)環(huán)境
  • Centos 6.5 服務(wù)器優(yōu)化配置備忘(一些基礎(chǔ)優(yōu)化和安全設(shè)置)
  • centos最小化安裝系統(tǒng)后的基本調(diào)優(yōu)及安全設(shè)置
  • centos 5.1下的安全設(shè)置(適合所有的linux版本)
  • CentOS的圖形安裝及初始環(huán)境設(shè)置教程
  • CentOS防火墻用法淺析

標(biāo)簽:婁底 馬鞍山 許昌 金昌 淘寶邀評(píng) 巴彥淖爾 邵陽(yáng) 赤峰

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《一個(gè)Linux系統(tǒng)安全設(shè)置的Shell腳本的分享(適用CentOS)》,本文關(guān)鍵詞  一個(gè),Linux,系統(tǒng),安全,設(shè)置,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問(wèn)題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無(wú)關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《一個(gè)Linux系統(tǒng)安全設(shè)置的Shell腳本的分享(適用CentOS)》相關(guān)的同類(lèi)信息!
  • 本頁(yè)收集關(guān)于一個(gè)Linux系統(tǒng)安全設(shè)置的Shell腳本的分享(適用CentOS)的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章
    主站蜘蛛池模板: 安远县| 福州市| 柏乡县| 中阳县| 广宗县| 北流市| 宝坻区| 维西| 通州市| 永定县| 内黄县| 彭泽县| 伊宁县| 姚安县| 台安县| 庄浪县| 闸北区| 景宁| 瑞昌市| 田林县| 祁阳县| 牟定县| 吴堡县| 天津市| 剑河县| 天门市| 夹江县| 宜丰县| 水富县| 滕州市| 新建县| 黄陵县| 雅江县| 滕州市| 东海县| 芜湖县| 荃湾区| 宁海县| 高唐县| 疏勒县| 阳曲县|