首页 > 代码库 > 使用pure-ftpd搭建FTP服务
使用pure-ftpd搭建FTP服务
使用pure-ftpd搭建FTP服务
pure-ftpd 官网 http://www.pureftpd.org/project/pure-ftpd
wget http://download.pureftpd.org/pub/pure-ftpd/releases/pure-ftpd-1.0.32.tar.bz2
tar jxf pure-ftpd-1.0.32.tar.bz2
cd pure-ftpd-1.0.32
./configure --prefix=/usr/local/pureftpd --without-inetd --with-altlog --with-puredb --with-throttling --with-peruserlimits --with-tls
make && make install
cd /usr/local/pureftpd/
cd configuration-file
mkdir -p /usr/local/pureftpd/etc/
cp pure-ftpd.conf /usr/local/pureftpd/etc/pure-ftpd.conf
cp pure-config.pl /usr/local/pureftpd/sbin/pure-config.pl
chmod 755 /usr/local/pureftpd/sbin/pure-config.pl
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
mkdir /data/ftp #创建ftp服务的目录
useradd www #创建以哪个账号的身份登录ftp
/usr/local/pureftpd/bin/pure-pw useradd test1 -unobody -d /data/ftp #建立虚拟账号
test1链接标识,nobody是用户名
/usr/local/pureftpd/bin/pure-pw mkdb #创建密码文件 ,让他生效
/usr/local/pureftpd/bin/pure-pw list #列出用户
/usr/local/pureftpd/bin/pure-pw userdel test1 #删除账号
启动pure-ftpd服务的命令:
/usr/local/pureftpd/sbin/pure-config.pl /usr/local/pureftpd/etc/pure-ftpd.conf
ls /usr/local/pureftpd/etc/
在客户端登陆远程的ftp,有这两个命令lftp,ftp
lftp test1@192.168.1.169 需要安装这个命令 yum install -y fltp
ftp 192.168.1.169 需要安装这个命令 yum install -y ftp
iptables -nvL
service iptables stop
/etc/inid.d/iptables save
getenforce
查看日志 tail /var/log/messages
grep nobody /etc/passwd
把他的uid改一下,上面限制是99
vim /etc/passwd
重启一下
killall pure-ftpd
/usr/local/pureftpd/sbin/pure-config.pl /usr/local/pureftpd/etc/pure-ftpd.conf
再不行就换别的用户试一下
/usr/local/pureftpd/bin/pure-pw useradd test3 -ubier -d /data/ftp
登录上去测试
下载 get aaa
上传 put bbb
本文出自 “比尔linux运维笔记” 博客,请务必保留此出处http://chenshoubiao.blog.51cto.com/6159058/1885204
使用pure-ftpd搭建FTP服务