CentOS安装 pure-ftpd

yum -y install pam-devel



cd /usr/local

tar zxf pure-ftpd-1.0.36.tar.gz

cd pure-ftpd-1.0.36



./configure --prefix=/usr/local/pure-ftpd/ --with-puredb

make && make check && make install
mkdir -p /usr/local/pure-ftpd/etc/ touch /usr/local/pure-ftpd/etc/pureftpd.passwd /usr/local/pure-ftpd/bin/pure-pw mkdb /usr/local/pure-ftpd/etc/pureftpd.pdb cd /usr/local/pure-ftpd-1.0.36/configuration-file cp /usr/local/pure-ftpd-1.0.36/configuration-file/pure-ftpd.conf /usr/local/pure-ftpd-1.0.36/configuration-file/pure-ftpd.conf.backup vim /usr/local/pure-ftpd-1.0.36/configuration-file/pure-ftpd.conf 配置文件里 pure-ftpd.conf 指定pdb位置 PureDB /usr/local/pure-ftpd/etc/pureftpd.pdb 修改端口 PassivePortRange 30000 30500 chmod 777 /usr/local/pure-ftpd-1.0.36/configuration-file/pure-config.pl /usr/local/pure-ftpd-1.0.36/configuration-file/pure-config.pl /usr/local/pure-ftpd-1.0.36/configuration-file/pure-ftpd.conf 使用 id www 查看组信息 大概会输出以下内容 uid=500(www) gid=500(www) 组=500(www) # 添加虚拟用户并映射到www用户 # 语法 /usr/local/pure-ftpd/bin/pure-pw useradd $user -u $uid -g $gid -d $dir -m /usr/local/pure-ftpd/bin/pure-pw useradd wfc_ftp -u 500 -g 500 -d /data/www -m # 添加防火墙规则 vim /etc/sysconfig/iptables # 在适当位置添加 -A INPUT -p tcp --dport 21 -j ACCEPT -A INPUT -p tcp --dport 30000:30500 -j ACCEPT service iptables restart # pure-ftpd 命令帮助 # 查看已有用户 /usr/local/pure-ftpd/bin/pure-pw list # 删除用户 /usr/local/pure-ftpd/bin/pure-pw userdel $user -m # 修改密码 /usr/local/pure-ftpd/bin/pure-pw passwd $user -m

# 新增用户后,要更新到数据库中,执行
/usr/local/pure-ftpd/bin/pure-pw mkdb

# 禁止匿名用户登录
vi /etc/passwd
ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin 这行注释掉或删除

 

你可能感兴趣的:(centos)