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
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、启动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
10、建立虚拟账号
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(创建用户信息数据库文件) yum install -y lftp[root@redhat configuration-file]# lftp [email protected]
lftp [email protected]:/>
12、在客户端远程登陆
yum install -y lftp
lftp [email protected]:/> mkdir 123
mkdir 成功, 建立 `123'
lftp [email protected]:/> 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 [email protected]:/> get 123.txt
lftp [email protected]:/> 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所有支持的命令