1、下载pureftp程序上传到/usr/local/src目录
cd /usr/local/src/
2、解压
tar -zxvf pure-ftpd-1.0.37.tar.gz
3、配置编译参数
cd pure-ftpd-1.0.37
./configure --prefix=/usr/local/pureftpd --without-inetd --with-altlog --with-puredb --with-throttling --with-peruserlimits --with-tls
4、编译
make
5、安装
make install
6、拷贝配置文件
cd /usr/local/src/pure-ftpd-1.0.37/configuration-file/
cp pure-ftpd.conf /usr/local/pureftpd/etc/pure-ftpd.conf
7、拷贝启动文件
cp pure-config.pl /usr/local/pureftpd/sbin/pure-config.pl
chmod 755 /usr/local/pureftpd/sbin/pure-config.pl
8、编辑配置文件
> /usr/local/pureftpd/etc/pure-ftpd.conf
vim /usr/local/pureftpd/etc/pure-ftpd.conf
ChrootEveryone yes
BrokenClientsCompatibility no
MaxClientsNumber 50
Daemonize yes
MaxClientsPerIP 8
VerboseLog no
DisplayDotFiles yes
AnonymousOnly no
NoAnonymous no
SyslogFacility ftp
DontResolve yes
MaxIdleTime 15
PureDB /usr/local/pureftpd/etc/pureftpd.pdb#此处一定要把前面的#注释去掉,否则无法登陆,指定用户数据库文件路径
LimitRecursion 3136 8
AnonymousCanCreateDirs no
MaxLoad 4
AntiWarez yes
Umask 133:022
MinUID 100 #最小UID为100
AllowUserFXP no
AllowAnonymousFXP no
ProhibitDotFilesWrite no
ProhibitDotFilesRead no
AutoRename no
AnonymousCantUpload no
PIDFile /usr/local/pureftpd/var/run/pure-ftpd.pid
MaxDiskUsage 99
CustomerProof yes
9、建立虚拟账号
mkdir /tmp/ftp
useradd river
chown -R river /tmp/ftp /usr/local/pureftpd/bin/pure-pw useradd ftpuser1 -uriver -d /tmp/ftp(将虚拟账号ftpuser1和系统用户river关联) /usr/local/pureftpd/bin/pure-pw mkdb(创建用户信息数据库文件)
#指定用户目录的时候会在/etc/pure-ftpd/pureftpd.passwd用户配置文件的路径后面添加./...........这种字符的会有导致错误的问题,需要检查一下这个文件的路径后面是否自动生成特殊字符,删除特殊字符
#/usr/local/pureftpd/bin/pure-pw list列出用户
#/usr/local/pureftpd/bin/pure-pw userdel删除用户
10、启动pure-ftpd
/usr/local/pureftpd/sbin/pure-config.pl /usr/local/pureftpd/etc/pure-ftpd.conf 加入这一行实现开机启动 vim /etc/rc.d/rc.local /usr/local/pureftpd/sbin/pure-config.pl /usr/local/pureftpd/etc/pure-ftpd.conf
yum install -y lftp
[root@redhat configuration-file]# lftp ftpuser1@127.0.0.1
口令:
lftp ftpuser1@127.0.0.1:~> ls
drwxr-xr-x 2 502 river 4096 May 31 14:43 .
drwxr-xr-x 2 502 river 4096 May 31 14:43 ..
-rw-r--r-- 1 502 river 0 May 31 14:43 123.txt
lftp ftpuser1@127.0.0.1:/>
11、在客户端远程登陆
yum install -y lftp
lftp ftpuser1@10.10.13.247:/> mkdir 123
mkdir 成功, 建立 `123'
lftp ftpuser1@10.10.13.247:/> ls
drwxr-xr-x 3 502 river 4096 May 31 16:06 .
drwxr-xr-x 3 502 river 4096 May 31 16:06 ..
drwxr-xr-x 2 502 river 4096 May 31 16:06 123
-rw-r--r-- 1 502 river 0 May 31 14:43 123.txt
lftp ftpuser1@10.10.13.247:/> get 123.txt
lftp ftpuser1@10.10.13.247:/> quit
[root@redhat01 opt]# ls\
> ^C
[root@redhat01 opt]# ls
123.txt 1.txt 2.txt 3.txt 4.txt
[root@redhat01 opt]#
可以看到成功连接并下载使用get下载使用put上传,使用?查看lftp所有支持的命令