记录在阿里云服务器上部署FTP
需求
- 用户有访问指定目录的权限
- 用户只能在当前目录
- 可以通过浏览器访问ftp
过程:
- 添加用户:
useradd -s /sbin/nologin -d /home/ftpuser ftpuser
-s : 限制用户不能登陆终端
-d :指定用户主目录 - 配置vsftp服务器:
#进入vsftpd的配置文件
vim /etc/vsftpd/vsftpd.conf
# (Warning! chroot'ing can be very dangerous. If using chroot, make sure that
# the user does not have write access to the top level directory within the
# chroot)
chroot_local_user=YES
chroot_list_enable=YES
# (default follows)
chroot_list_file=/etc/vsftpd/vsftpd.chroot_list
#
# You may activate the "-R" option to the builtin ls. This is disabled by
# default to avoid remote users being able to cause excessive I/O on large
# sites. However, some broken FTP clients such as "ncftp" and "mirror" assume
配置解析:
chroot_local_user=YES //限制所有用户在自己的目录下不能更改
ch