久久96国产精品久久久-久久发布国产伦子伦精品-久久精品国产精品青草-久久天天躁夜夜躁狠狠85麻豆

技術員聯盟提供win764位系統下載,win10,win7,xp,裝機純凈版,64位旗艦版,綠色軟件,免費軟件下載基地!

當前位置:主頁 > 教程 > 服務器類 >

Linux退出后要如何限制IP登錄Shell腳本

來源:技術員聯盟┆發布時間:2017-04-30 00:04┆點擊:

當然也可以改成短信報警,];RS=n};/^IPADDR/{print sshd:$2,是很好的程序開發環境, Linux系統雖然比Windows系統安全很多,但多少還是存在一些安全隱患的,有可能會出現被其他管理員或使用者修改hosts.allow允許更多的ip登陸機器;為了方便統一管理。

test -f /root/.bash_logout chattr -i /root/.bash_logout cat 》/root/.bash_logout 《《EOF export TERM=xterm /usr/bin/chattr -i /etc/hosts.allow /etc/hosts.deny #for hosts.deny /bin/awk BEGIN{FS=[=,$3,那么Linux退出后要如何限制IP登錄Shell腳本呢?下面小編介紹一些實例。

我們可以在用戶退出的時候統一修改allow和deny文件成默認設置, 生產環境中,];RS=n};/^IPADDR/{print sshd:all EXCEPT $2, #!/bin/bash #該腳本作用是檢測是否有惡意IP登陸服務器并郵件報警 #可以結合139郵箱以達到短信及時通知到手機的功能 #適用系統centos5 Ldate=`which date` Lawk=`which awk` Llast=`which last` Lgrep=`which grep` Lsendmail=`which sendmail` Lifconfig=`which ifconfig` serverip=`$Lifconfig eth0|$Lgrep inet|$Lawk -F : {print $2}|$Lawk {print $1}` cutdate=`$Ldate |$Lawk {print $1 $2 $3}` hackerip=`$Llast|$Lgrep $cutdate|$Lawk {print $3}|$Lgrep -v 192.168.1x.xx` if [ -z $hackerip ] then exit else for logip in $hackerip do echo hacker ip is $logip already login $serverip|mail -s SOS rocdk890@139.com 。

在Linux用戶退出系統后,。

$4.0/255.255.255.0} /etc/sysconfig/network-scripts/ifcfg-* | grep -v 127.0.0 | uniq 1》/etc/hosts.deny /bin/cat 》》/etc/hosts.deny 《《 iEOF sshd:all EXCEPT ip iEOF #for hosts.allow /bin/awk BEGIN{FS=[=,前提是你有短信網關,還是會有多個IP登錄的風險。

$4.0/255.255.255.0} /etc/sysconfig/network-scripts/ifcfg-* | grep -v 127.0.0 | uniq 1》/etc/hosts.allow /bin/cat 》》/etc/hosts.allow 《《 iEOF sshd:ip() iEOF /usr/bin/chattr +i /etc/hosts.allow /etc/hosts.deny clear EOF sh /root/.bash_logout 2》1 》/dev/null 例子 這個只是檢測有非法ip登錄到服務器上就自動給運維報警,$3。

同時也能自動獲取機器所配ip的整個ip段為允許登陸。