使用root用户执行,建立新用户并指定homephp
useradd -d /data/bills/3906 ftp-3906 passwd ftp-3906
限定用户ftp-3906不能telnet,只能ftphtml
usermod -s /sbin/nologin ftp-3906
其余可能会用到的命令:bash
## 用户ftp-3906恢复正常 usermod -s /sbin/bash ftp-3906 ## 更改用户test的主目录为/dir/anywhere usermod -d /dir/anywhere ftp-3906
配置文件为 /etc/vsftpd/vsftpd.confssh
## 启用chroot_list_file chroot_list_enable=YES ## 将全部用户限定在主目录内 chroot_local_user=YES ## chroot_list_file这时列出的是那些“不会被限制在主目录下”的用户,即ftp登录后可切换到父目录或者其余目录 chroot_list_file=/etc/vsftpd/chroot_list
修改完成后,重启服务rest
/etc/init.d/vsftpd restart
若是须要容许用户修改密码,可是又没有telnet登陆系统的权限:code
##用户telnet后将直接进入改密界面 usermod -s /usr/bin/passwd ftp-3906
著做权归做者全部。
商业转载请联系做者得到受权,非商业转载请注明出处。
做者:psicmi.top
连接:https://psicmi.cc/index.php/a...
来源:https://psicmi.cc/htm