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 這行註釋掉或刪除
相關文章
相關標籤/搜索