lampp中的ftp使用介绍

搭建完毕lampp

具体要求如下:使用Lampp的proftpd,开通多个FTP用户,并各分配一个目录,而且需要限制用户在自己的目录里面,可以自由读写.

操作步骤:
第一步:设置ftp用户组,输入命令:

$ groupadd ftpusers #创建用户级ftpusers

第二步:创建用户目录用户密码,输入命令:

 $ mkdir /www/ #创建目录www
 $ chmod -R 777 /www/ #设置权限,好像必须777
 $ useradd -d /www/ -g ftpusers -s /sbin/nologin ftp1 #增加用户ftp1
 $ passwd ftp1 #修改用户名ftp1的密码

 如果提示

useradd: warning: the home directory already exists.
Not copying any file from skel directory into it.

表示添加成功,但是有警告而已

 注:如是想多加用户与目录请重新第二步

第三步:简单配置proftpd,输入命令:

vi /opt/lampp/etc/proftpd.conf #打开proftpd配置文件proftpd.conf

修改内容:
 DefaultRoot ~ ftpusers #限定目录内
 #设置所有权限,解决用FTP上传不能覆盖
 AllowOverwrite on

第四步:重启proftpd

/opt/lampp/lampp reloadftp #重启proftpd

附:如果连接FTP时速度慢,请在proftpd配置文件proftpd.conf 中加入以下内容:
 # Slow logins
 # This is probably caused by a firewall or DNS timeout. By default ProFTPD will try to do both DNS and ident lookups against the
 # incoming connection. If these are blocked or excessively delayed a slower than normal login will result. To turn off DNS and ident
 # use:
 UseReverseDNS off
 IdentLookups off

原文地址:https://www.cnblogs.com/baker95935/p/9698621.html