[关闭]
@orangleliu 2015-05-12T08:34:38.000000Z 字数 660 阅读 1320

#Centos 安装ftp服务

安装过程

  1. sudo yum install vsftpd

基本配置

  1. sudo vim /etc/vsftpd/vsftpd.conf

修改或者注意的几个配置

  1. anonymous_enable=NO
  2. local_enable=YES
  3. chroot_local_user=YES

启动,开机启动

  1. sudo service vsftpd restart
  2. chkconfig vsftpd on

添加用户和权限

  1. 建用户:在root用户下:
    useradd test //增加用户test,并制定test用户的主目录为/home/test
    passwd test //为test设置密码
  2. 更改用户相应的权限设置:
    usermod -s /sbin/nologin test //限定用户test不能telnet,只能ftp
    usermod -s /sbin/bash test //用户test恢复正常
    usermod -d /test test //更改用户test的主目录为/test
  3. 限制用户只能访问/home/test,不能访问其他路径
    修改/etc/vsftpd/vsftpd.conf如下:
    chroot_list_enable=YES //限制访问自身目录
    # (default follows)
    chroot_list_file=/etc/vsftpd/vsftpd.chroot_list
    编辑 vsftpd.chroot_list文件,将受限制的用户添加进去,每个用户名一行
    改完配置文件,不要忘记重启vsFTPd服务器

参考连接
how-to-set-up-vsftpd-on-centos-6

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注