Proftpd权限的设置原理
创始人
2024-07-21 16:01:09
0

ProFTPD是继Wu-FTP之后最为流行的FTP服务器软件。Proftpd的权限都需要设置才能稳定运行,本文给大家介绍下他的原理!

  一、测试平台

  Debian 4.0r3

  Proftpd 1.3.1 (WITH SSL)

  二、原理简介

  1、 继承性

  子目录会继承其父目录的属性。

  2、 优先级

  优先级由大到小的顺序:

  原始FTP命令(LIST DELE等) > 命令组(DIRS READ WRITE) > ALL命令组

  3、 访问控制的应用顺序

  不论出现顺序如何,先应用拒绝(Deny),后应用允许(Allow)

  4、系统权限

  Linux系统权限仍然起作用。如果设置了目录test的 允许写,但是该用户对test目录只有

  读权限,这是该用户就不能向test目录写入。

   ----------------- 1、继承性

   ------------------------- 2、优先级

  AllowUser u1 -------------------- 3、访问控制的应用顺序

  DenyAll

  一点解释:根据参考1所述,访问控制的顺序应该是与其出现顺序有关,但是在我的测试中发现出现顺序没有什么影响。也就是说,像上面的访问控制,AllowUser u1和DenyAll哪个在前面都一样。

  三、实例

  1、简介

  假设proftpd服务器上有5个用户:

  manager, manA1, manA2, manB1, manB2

  和2个组:

  groupA, groupB

  manA1和manA2属于groupA组,manB1和manB2属于groupB组。

  并且有如下目录结构:

 

  1.   /根目录  
  2.  
  3.   │  
  4.  
  5.   ├ftproot/  
  6.  
  7.   │ ├manager/  
  8.  
  9.   │ │  
  10.  
  11.   │ ├groupA/  
  12.  
  13.   │ │ ├A1/  
  14.  
  15.   │ │ ├A2/  
  16.  
  17.   │ │ └.../  
  18.  
  19.   │ │  
  20.  
  21.   │ ├groupB/  
  22.  
  23.   │ ├B1/  
  24.  
  25.   │ ├B2/  
  26.  
  27.   │ └.../  
  28.  
  29.   │  
  30.  
  31.   └.../  

 

  现在要实现的权限:

  1、用户manager可以读写manager、groupA、groupB目录及它们的的子目录。

  2、manA1可以读写A1目录,并且可以读写groupB的所有子目录。

  3、manA2可以读写A2目录,并且可以读写groupB的所有子目录。

  4、manB1可以读写B1目录。

  5、manB2可以读写B2目录。

  6、如果一个用户没有某个目录的访问权限,那么该用户就不能看到此目录。

  7、只允许manger用户和groupA、groupB组成员访问FTP服务器。

  8、不允许任何人破坏主干目录结构

  2、实现

  (1)添加用户和组

  useradd manager

  passwd manager

  groupadd groupA

  groupadd groupB

  useradd manA1

  passwd manA1

  usermod -G groupA manA1

  useradd manA2

  passwd manA2

  usermod -G groupA manA2

  useradd manB1

  passwd manB1

  usermod -G groupB manB1

  useradd manB2

  passwd manB2

  usermod -G groupB manB2

#p#

  (2)配置文件

 

  1.   # This is a basic ProFTPD configuration file (rename it to  
  2.  
  3.   # 'proftpd.conf' for actual use. It establishes a single server  
  4.  
  5.   # and a single anonymous login. It assumes that you have a user/group  
  6.  
  7.   # "nobody" and "ftp" for normal operation and anon.  

 

  ServerName "Formax BPO FTP Server"

  ServerType standalone

  DefaultServer on

  # Port 21 is the standard FTP port.

  Port 21

  UseReverseDNS off

  IdentLookups off# Umask 022 is a good standard umask to prevent new dirs and files

  # from being group and world writable.

  Umask 000

 

  1.   # To prevent DoS attacks, set the maximum number of child processes  
  2.  
  3.   # to 30. If you need to allow more than 30 concurrent connections  
  4.  
  5.   # at once, simply increase this value. Note that this ONLY works  
  6.  
  7.   # in standalone mode, in inetd mode you should use an inetd server  
  8.  
  9.   # that allows you to limit maximum number of processes per service  
  10.  
  11.   # (such as xinetd).  

 

  MaxInstances 30

  # Set the user and group under which the server will run.

  User nobody

  Group nogroup

 

  1.   # To cause every FTP user to be "jailed" (chrooted) into their home  
  2.  
  3.   # directory, uncomment this line.  
  4.  
  5.   # DefaultRoot ~  

 

  DefaultRoot /ftproot

  # Normally, we want files to be overwriteable.

  AllowOverwrite on

  AllowStoreRestart on

  ServerIdent off

  TLSEngine on

  TLSLog /var/ftpd/tls.log

  TLSProtocol SSLv23

  # Are clients required to use FTP over TLS when talking to this server?

  TLSRequired on

  # Server's certificate

  TLSRSACertificateFile /etc/proftpd.cert

  TLSRSACertificateKeyFile /etc/proftpd.key

  # CA the server trusts

  TLSCACertificateFile /etc/proftpd.cert

  # Authenticate clients that want to use FTP over TLS?

  TLSVerifyClient off

  TLSOptions NoCertRequest

 

  1.   # Allow SSL/TLS renegotiations when the client requests them, but  
  2.  
  3.   # do not force the renegotations. Some clients do not support  
  4.  
  5.   # SSL/TLS renegotiations; when mod_tls forces a renegotiation, these  
  6.  
  7.   # clients will close the data connection, or there will be a timeout  
  8.  
  9.   # on an idle data connection.  

 

  TLSRenegotiate required off

  # Bar use of SITE CHMOD by default

通过阅读全文,我们知道了Proftpd权限的设置原理,希望对大家有所帮助!

【编辑推荐】

  1. Proftpd环境下设定虚拟主机
  2. Proftpd不显示ftp服务器版本信息以增强安全性
  3. 实现Proftpf将其以后的访问限定在某个目录下
  4. ProFTPD 的特点
  5. ProFTPD 主要特色
  6. ProFTPD 操作过程
  7. Proftpd 简单介绍
  8. ProFTPD 安装与配置

相关内容

热门资讯

如何允许远程连接到MySQL数... [[277004]]【51CTO.com快译】默认情况下,MySQL服务器仅侦听来自localhos...
如何利用交换机和端口设置来管理... 在网络管理中,总是有些人让管理员头疼。下面我们就将介绍一下一个网管员利用交换机以及端口设置等来进行D...
施耐德电气数据中心整体解决方案... 近日,全球能效管理专家施耐德电气正式启动大型体验活动“能效中国行——2012卡车巡展”,作为该活动的...
20个非常棒的扁平设计免费资源 Apple设备的平面图标PSD免费平板UI 平板UI套件24平图标Freen平板UI套件PSD径向平...
德国电信门户网站可实时显示全球... 德国电信周三推出一个门户网站,直观地实时提供其安装在全球各地的传感器网络检测到的网络攻击状况。该网站...
为啥国人偏爱 Mybatis,... 关于 SQL 和 ORM 的争论,永远都不会终止,我也一直在思考这个问题。昨天又跟群里的小伙伴进行...
《非诚勿扰》红人闫凤娇被曝厕所... 【51CTO.com 综合消息360安全专家提醒说,“闫凤娇”、“非诚勿扰”已经被黑客盯上成为了“木...
2012年第四季度互联网状况报... [[71653]]  北京时间4月25日消息,据国外媒体报道,全球知名的云平台公司Akamai Te...