ProFTP已经成为继Wu-FTP之后最为流行的FTP服务器软件,越来越多的站点选用它构筑安全高效的FTP站点,ProFTP配置方便,并有MySQL和Quota模块可供选择,利用它们的完美结合可以实现非系统账号的管理和用户磁盘的限制。下面介绍如何安装和添加虚拟用户。
安装EPEL软件包
- rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
YUM安装ProFTPd
设置开机启动
- chkconfig --level 3 proftpd on
ProFTPd管理:
启动proftpd:service proftpd start
停止proftpd:service proftpd stop
重启proftpd:service proftpd restart
重载proftpd:service proftpd reload
配置文件/etc/proftpd.conf,可以通过proftpd -t6指令检测语法是否正确。
添加虚拟用户
首先我们需要设置配置文件/etc/proftpd.conf。
添加下面代码进配置文件:
- AuthUserFile /etc/ftpd.passwd
- AuthGroupFile /etc/ftpd.group
关闭检测/etc/shells:
设置仅使用虚拟用户认证:
- AuthOrder mod_auth_file.c
禁止PAM认证:
- PersistentPasswd off
- AuthPAM off
限制改变根目录:
按照上面的要求设置好配置文件后,我们使用ftpasswd工具来添加虚拟用户,首先下载这个工具。
- cd /usr/sbin/
- wget http://www.castaglia.org/proftpd/contrib/ftpasswd
- chmod +x ftpasswd
ftpasswd工具的格式如下:
- # ftpasswd --passwd --name {username} --file /etc/ftpd.passwd --uid {5000} --gid {5000} --home /var/ftp/username-home/ --shell /bin/false
- # ftpasswd --group --name group1 –file /etc/ftpd.group --gid 5000 --member username