Chinaunix首页 | 论坛 | 博客
  • 博客访问: 120910
  • 博文数量: 16
  • 博客积分: 383
  • 博客等级: 一等列兵
  • 技术积分: 170
  • 用 户 组: 普通用户
  • 注册时间: 2011-03-14 11:43
文章分类

全部博文(16)

文章存档

2014年(1)

2012年(3)

2011年(12)

分类: LINUX

2011-12-31 11:11:36

1,下载软件包proftpd-1.3.4a.tar.gz,然后安装
2,修改配置文件proftpd.conf 找到并修改一下配置,配置类似于apache
  1. # Set the user and group under which the server will run.
  2. User nobody
  3. Group nobody

  4. <Anonymous /var/ftp>
  5.   User ftp
  6.   Group ftp

  7.   # We want clients to be able to login with "anonymous" as well as "ftp"
  8.   UserAlias anonymous ftp

  9.   # Limit the maximum number of anonymous logins
  10.   MaxClients 10

  11.   # We want 'welcome.msg' displayed at login, and '.message' displayed
  12.   # in each newly chdired directory.
  13.   DisplayLogin welcome.msg
  14.   DisplayChdir .message

  15.   # Limit WRITE everywhere in the anonymous chroot
  16.   <Limit WRITE>
  17.     DenyAll
  18.   </Limit>
  19.   <Directory server>
  20.         <Limit STOR MKD>
  21.                 ALLOWALL
  22.         </Limit>
  23.   </Directory>
  24.   <Directory test>
  25.         <Limit STOR MKD WRITE>
  26.                 ALLOWALL
  27.         </Limit>
  28.   </Directory>
  29. </Anonymous>
limit的动作常用如下,
  1. CWD :Change Working Directory,变化目录;
  2. MKD :MaKe Directory,可否建立目录;
  3. RNFR :ReName FRom,可更改档案名;
  4. DELE :DELEt,可刪除档案;
  5. RMD :ReMove Directory,可否移除目录;
  6. RETR :RETRieve,由 Server 传送资料到Client;
  7. READ :可否读取
  8. WRITE:可否写入
  9. STOR :由 Client 传送资料到 Server !
  10. ALL :全部的动作!
 
 添加相应的组和用户, 然后添加相应的ftp目录并设置权限和组
 
proftp支持的变量,主要应用 welcome.msg,即登录ftp的欢迎界面
  1. %T 当前时间
  2. %F 所在硬盘剩下的容量
  3. %C 目前所在的目录
  4. %R Client 端的主机名称
  5. %L Server 端的主机名称
  6. %U 使用者账户
  7. %M 最大允许的连接人数
  8. %N 目前的主机连接人数
  9. %E FTP 主机管理员的 email
  10. %i 本次上传的档案数量
  11. %o 本次下载的档案数量
  12. %t 本次上传+下载的档案数量
另外proftp可以配置xinet启动方式,配置如下:
  1. service ftp
  2. {
  3. disable = no
  4. flags = REUSE
  5. socket_type = stream
  6. wait = no
  7. user = root
  8. server = /usr/local/proftpd/sbin/proftpd
  9. server_arg = -c /usr/local/proftpd/etc/proftp.conf
  10. log_on_success += DURATION USERID
  11. log_on_failure += USERID
  12. }
 
不要忘了修改proftp的配置文件,
  1. #ServerType standalone
  2. ServerType inetd
两者的区别查询其它资料,
 
在没有开启proftp的情况下,就可以用xinetd启动proftp服务了,至此基于centos的ftp服务器架设完毕
 
阅读(2604) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~