vsftp限制ip位址訪問

2021-08-22 08:26:39 字數 1554 閱讀 8907

vsftpd使用standalone模式啟動

(我的centos5.5沒

有builddefs.h這個檔案,直接從第二步開始,也沒什麼問題。)

3、 重啟vsftpd服務

service vsftpd restart

4、修改/etc/hosts.deny

加入vsftpd : all

5.修改/etc/hosts.allow

加入vsftpd:.admin99.net

vsftpd:192.168.0.

vsftpd:192.168.0.0/255.255.255.0

第一行表示,只有admin99.net這個域裡的主機允許訪問vsftpd服務,注意admin99.net前面的那個點(.);

/第二行表示,只有192.168.0這個網段的使用者允許訪問vsftpd服務,注意0後面的點(.);

第三行表示,只有192.168.0這個網段的使用者允許訪問vsftpd服務,注意這裡不能寫為192.168.0.0/24。

vsftpd服務是由xinetd管理的話,可以修改/etc/xinetd.d/

/vsftpd配置檔案,加入only_from  =  ip段即可。

附錄:

限制ftp與ssh服務的訪問ip

1、修改檔案:/etc/hosts.deny,加上最後兩行,阻止所以進入,如下:

# hosts.deny    this file describes the names of the hosts which are

#               *not* allowed to use the local inet services, as decided

#               by the '/usr/sbin/tcpd' server.

## the portmap line is redundant, but it is left to remind you that

# the new secure portmap uses hosts.deny and hosts.allow. in particular

# you should know that nfs uses portmap!

sshd:all

vsftpd:all

2、修改 /etc/hosts.allow,加上允許訪問的ip,如下: #

# hosts.allow   this file describes the names of the hosts which are

#               allowed to use the local inet services, as decided

#               by the '/usr/sbin/tcpd' server.

##sshd

sshd:192.168.0.125

sshd:192.168.0.126

#vsfptd

vsftpd:192.168.0.125

vsftpd:192.168.0.126

限制IP位址訪問資料庫

通過使用資料庫伺服器端的sqlnet.ora檔案可以實現禁止指定ip主機訪問資料庫的功能,這對於提公升資料庫的安全性有很大 的幫助,與此同時,這個技術為我們管理和約束資料庫訪問控制提供了有效的手段。方法 在sqlnet.ora檔案下黏貼這個 tcp.validnode checking yes tc...

限制IP訪問

本文以python為基礎 問題描述 後台伺服器如何限制某些特定ip的訪問?問題分析 如果對ip進行限制,那麼第一步就必須得到使用者的ip,才能進行限制,第二部才是限制 問題解決 得到使用者ip 首先,python提供了獲取ip的 語句 ip request.remote addr但是通過這行 我們卻...

限制ip訪問 dtcms限制部分IP訪問文章

是否存在於ip列表 public bool getip string ipa 是否存在於ip列表 protected bool getip 1 新建頻道 控制面板 站點管理 頻道管理 新增 以kaohetongbao為例 2 頻道url配置 列表頁kaohetongbao all表示式 1 kaoh...