centos下添加ftp用户

添加用户

useradd -d /data/www -g ftp -s /sbin/nologin username
-d 指定目录
-g 指定用户组
-s 指定用户不可以登录
切换用户目录
usermod -d /data/www username

设置密码

passwd username
输入两次密码

修改ftp配置文件

  1. 打开/etc/vsftpd/vsftpd.conf,修改
    userlist_enable=YES userlist_deny=NO userlist_file=/etc/vsftpd/user_list
  2. 用户加入到/etc/vsftpd/user_list
  3. 重启ftp
    /etc/init.d/vsftpd restart

其他命令

  1. 查看ftp 状态
    service vsftpd status
    ps -ef | grep ftp

你可能感兴趣的:(centos下添加ftp用户)