1,下载软件包proftpd-1.3.4a.tar.gz,然后安装
2,修改配置文件proftpd.conf 找到并修改一下配置,配置类似于apache
- # Set the user and group under which the server will run.
- User nobody
- Group nobody
- <Anonymous /var/ftp>
- User ftp
- Group ftp
- # We want clients to be able to login with "anonymous" as well as "ftp"
- UserAlias anonymous ftp
- # Limit the maximum number of anonymous logins
- MaxClients 10
- # We want 'welcome.msg' displayed at login, and '.message' displayed
- # in each newly chdired directory.
- DisplayLogin welcome.msg
- DisplayChdir .message
- # Limit WRITE everywhere in the anonymous chroot
- <Limit WRITE>
- DenyAll
- </Limit>
- <Directory server>
- <Limit STOR MKD>
- ALLOWALL
- </Limit>
- </Directory>
- <Directory test>
- <Limit STOR MKD WRITE>
- ALLOWALL
- </Limit>
- </Directory>
- </Anonymous>
limit的动作常用如下,
- CWD :Change Working Directory,变化目录;
- MKD :MaKe Directory,可否建立目录;
- RNFR :ReName FRom,可更改档案名;
- DELE :DELEt,可刪除档案;
- RMD :ReMove Directory,可否移除目录;
- RETR :RETRieve,由 Server 传送资料到Client;
- READ :可否读取
- WRITE:可否写入
- STOR :由 Client 传送资料到 Server !
- ALL :全部的动作!
添加相应的组和用户, 然后添加相应的ftp目录并设置权限和组
proftp支持的变量,主要应用 welcome.msg,即登录ftp的欢迎界面
- %T 当前时间
- %F 所在硬盘剩下的容量
- %C 目前所在的目录
- %R Client 端的主机名称
- %L Server 端的主机名称
- %U 使用者账户
- %M 最大允许的连接人数
- %N 目前的主机连接人数
- %E FTP 主机管理员的 email
- %i 本次上传的档案数量
- %o 本次下载的档案数量
- %t 本次上传+下载的档案数量
另外proftp可以配置xinet启动方式,配置如下:
- service ftp
- {
- disable = no
- flags = REUSE
- socket_type = stream
- wait = no
- user = root
- server = /usr/local/proftpd/sbin/proftpd
- server_arg = -c /usr/local/proftpd/etc/proftp.conf
- log_on_success += DURATION USERID
- log_on_failure += USERID
- }
不要忘了修改proftp的配置文件,
- #ServerType standalone
- ServerType inetd
两者的区别查询其它资料,
在没有开启proftp的情况下,就可以用xinetd启动proftp服务了,至此基于centos的ftp服务器架设完毕
阅读(2635) | 评论(0) | 转发(0) |