為了保證linux服務(wù)器網(wǎng)絡(luò)的安全,需要禁止服務(wù)器訪問某些不健康的網(wǎng)站。實操請往下看:
怎么保證linux服務(wù)器的網(wǎng)絡(luò)安全?
1.對指定網(wǎng)站禁止訪問
iptables支持試用域名和ip地址兩種方法來指定禁止的網(wǎng)站。如果使用域名的方式指定網(wǎng)站,iptables會通過dns服務(wù)器查詢該域名對應(yīng)的所有ip地址,并將這些ip地址加入到規(guī)則中,所以使用域名指定網(wǎng)站時,iptables的執(zhí)行速度會稍慢。
命令如下:
[root@localhost ~]# iptables -i forward -d www.xxx.com -j drop
[root@localhost ~]# iptables -t filter -l forward
2.禁止linux服務(wù)器上網(wǎng)
操作命令如下:
[root@localhost ~]# iptables -i forward -s 192.168.1.102 -j drop
[root@localhost ~]# iptables -t filter -l forward
3.禁止linux服務(wù)器訪問某些訪問
端口是tcp/ip使用“端口”來區(qū)分系統(tǒng)中的不同的服務(wù),如web服務(wù)使用的是tcp 80端口,ftp服務(wù)使用的是tcp 21端口等。由于不同的服務(wù)會使用不同的端口與外界進行通信,因此要禁止linux服務(wù)器上的某些訪問,只要禁止服務(wù)使用的端口號即可。
操作命令如下:
[root@localhost ~]# iptables -i froward -s 192.168.1.0/24 -p tcp –dport 21 -j drop
[root@localhost ~]# iptables -t filter -l froward
聲明:文章來自網(wǎng)絡(luò)轉(zhuǎn)載,若無意中有侵犯您權(quán)益的信息,請聯(lián)系我們,我們會在第一時間刪除!
權(quán)重與反鏈的密碼親密關(guān)系降低網(wǎng)站跳出率的方法有哪些企業(yè)做網(wǎng)站設(shè)計要注意什么呢詳談電子商務(wù)網(wǎng)站建設(shè)需求分析詳細分析營銷型企業(yè)網(wǎng)站的優(yōu)勢網(wǎng)站建設(shè)有幾大類?瀏覽器兼容性問題