CentOS 5.x YUM安装ProFTPd与添加虚拟用户

ProFTP已经成为继Wu-FTP之后最为流行的FTP服务器软件,越来越多的站点选用它构筑安全高效的FTP站点,ProFTP配置方便,并有MySQL和Quota模块可供选择,利用它们的完美结合可以实现非系统账号的管理和用户磁盘的限制。下面介绍如何安装和添加虚拟用户。

安装EPEL软件包

  1. rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm

YUM安装ProFTPd

  1. yum install proftpd

设置开机启动

  1. 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。
添加下面代码进配置文件:

  1. AuthUserFile /etc/ftpd.passwd
  2. AuthGroupFile /etc/ftpd.group

关闭检测/etc/shells:

  1. RequireValidShell off

设置仅使用虚拟用户认证:

  1. AuthOrder mod_auth_file.c

禁止PAM认证:

  1. PersistentPasswd off
  2. AuthPAM off

限制改变根目录:

  1. DefaulRoot ~

按照上面的要求设置好配置文件后,我们使用ftpasswd工具来添加虚拟用户,首先下载这个工具。

  1. cd /usr/sbin/
  2. wget http://www.castaglia.org/proftpd/contrib/ftpasswd
  3. chmod +x ftpasswd

ftpasswd工具的格式如下:

  1. # ftpasswd --passwd --name {username} --file /etc/ftpd.passwd --uid {5000} --gid {5000} --home /var/ftp/username-home/ --shell /bin/false
  2. # ftpasswd --group --name group1 –file /etc/ftpd.group --gid 5000 --member username
标签:YumCentos 发布于:2019-10-06 05:09:35