cd /home && wget http://vr.91city.com/pure-ftpd-1.0.46.tar.gz && tar -zxvf pure-ftpd-1.0.46.tar.gz && cd pure-ftpd-1.0.46 && ./configure --prefix=/usr/local/pureftpd --without-inetd --with-altlog --with-puredb --with-throttling --with-peruserlimits --with-tls && make && make install
groupadd www && useradd -r -g www -s /bin/false www
ln -s /usr/local/pureftpd/sbin/pure-ftpd /usr/bin/pure-ftpd
ln -s /usr/local/pureftpd/bin/pure-pw /usr/bin/pure-pw
/usr/local/pureftpd/bin/pure-pw useradd cfpt -uwww -d /www
/usr/local/pureftpd/bin/pure-pw mkdb【必须要有】
/usr/local/pureftpd/bin/pure-pw usermod f315 -u www -g www -m【添加新用户时:必须要更新虚拟帐号才会生效】
pure-pw还可以列出当前的ftp账号,也可以删除某个账号:
/usr/local/pureftpd/bin/pure-pw list
【删除用户】/usr/local/pureftpd/bin/pure-pw userdel cftp2
vim /usr/local/pureftpd/etc/pure-ftpd.conf
----------------------------------------------
修改如下两处存放目录:
PureDB /usr/local/pureftpd/etc/pureftpd.pdb
PIDFile /usr/local/pureftpd/var/run/pure-ftpd.pid
MinUID 10
Bind ,8221 #[有个坑,坑,坑,腾讯云改为非21端口,出现227错误]
NoAnonymous yes #不允许匿名用户连接
PassivePortRange 5000 6000 # 被动模式端口范围
----------------------------------------------
/usr/local/pureftpd/sbin/pure-ftpd /usr/local/pureftpd/etc/pure-ftpd.conf //启动pureftpd
vim /usr/lib/systemd/system/pureftpd.service
-------------------
[Unit]
Description=pureftpd
After=network.target remote-fs.target nss-lookup.target
[Service]
Type=forking
ExecStart=/usr/local/pureftpd/sbin/pure-ftpd /usr/local/pureftpd/etc/pure-ftpd.conf
ExecReload=killall pure-ftpd && /usr/local/pureftpd/sbin/pure-ftpd /usr/local/pureftpd/etc/pure-ftpd.conf
ExecStop=killall pure-ftpd
[Install]
WantedBy=multi-user.target
----------------------------
chmod 754 /usr/lib/systemd/system/pureftpd.service
systemctl enable pureftpd.service
systemctl restart pureftpd.service
vi /etc/ssh/sshd_config
------------------------
port 8222
-------------------------
firewall-cmd --list-ports
systemctl start firewalld.service
firewall-cmd --list-ports
firewall-cmd --zone=public --add-port=8222/tcp --permanent
firewall-cmd --zone=public --add-port=80/tcp --permanent
firewall-cmd --zone=public --add-port=8221/tcp --permanent
firewall-cmd --zone=public --add-port=8226/tcp --permanent
firewall-cmd --zone=public --add-port=5000-6000/tcp --permanent
firewall-cmd --reload
firewall-cmd --list-ports
==============添加新用户===============
/usr/local/pureftpd/bin/pure-pw useradd f315 -u www -d /www/vr/ -f /usr/local/pureftpd/etc/pureftpd.passwd
/usr/local/pureftpd/bin/pure-pw passwd f315(修改密码)
/usr/local/pureftpd/bin/pure-pw show f315(查看用户使用情况)
chown www:www -R /home/wwwroot/你的目录/
pure-pw userdel[-f] [-m](删除用户) /usr/local/pureftpd/bin/pure-pw userdel f100315
必须要更新虚拟帐号才会生效:
pure-pw usermod f315 -u www -g www -m
service pureftpd restart (必须重启centos6)
华旅网络 |