求助!pure-ftp怎么限制登录ip段?

Web、Mail、Ftp、DNS、Proxy、VPN、Samba、LDAP 等基础网络服务
回复
zbathena
帖子: 19
注册时间: 2008-11-09 19:20

求助!pure-ftp怎么限制登录ip段?

#1

帖子 zbathena » 2012-01-10 14:37

如题。

:em06
死亡阴影
帖子: 130
注册时间: 2007-11-28 8:52
联系:

Re: 求助!pure-ftp怎么限制登录ip段?

#2

帖子 死亡阴影 » 2012-01-10 21:12

在/etc/hosts.deny 限制 协议和IP段吧
zbathena
帖子: 19
注册时间: 2008-11-09 19:20

Re: 求助!pure-ftp怎么限制登录ip段?

#3

帖子 zbathena » 2012-01-12 21:06

死亡阴影 写了:在/etc/hosts.deny 限制 协议和IP段吧
貌似不能这么做,因为我打算让某ip段的用户可以使用下载帐号,但不能使用上传帐号。
如果在hosts里限制了,应该啥帐号都不能用了吧?
zbathena
帖子: 19
注册时间: 2008-11-09 19:20

Re: 求助!pure-ftp怎么限制登录ip段?

#4

帖子 zbathena » 2012-01-12 21:58

搞定了。。

可以在虚拟用户中设置,在http://download.pureftpd.org/pub/pure-ftpd/doc/README.Virtual-Users
中有这么一段:
-r and -R are handy to restrict where the user can connect from. They can be
followed by a simple IP/mask pair (-r 192.168.1.0/24), multiple pairs
separated by a coma (-r 192.168.1.0/24,10.1.0.0/16,127.0.0.1/32), single IPs
(-r 192.168.1.4,10.1.1.5), host names (-r bla.bla.net,yopcitron.com), or any
combination of those.
总结一下给懒得看英文的朋友:
在使用pure-pw useradd添加虚拟用户,
或者pure-pw usermod修改虚拟用户设置的时候,
通过下面的选项限制登录ip段
-r ip/mask
或者
-R ip/mask
r表示允许登录的ip段,R表示禁止登录的。
多个ip段用逗号隔开。
回复