sudo apt-get update #更新系统
sudo apt-get install vsftpd #安装vsftpd
sudo systemctl status vsftpd #判断vsftpd是否安装成功
In the terminal output, active (running) is generally highlighted in green.
sudo mkdir/home/user-ftp1 #建立/HOME/USER-FTP1 directory
sudo useradd-d/HOME/USER-FTP1
#建立ftp-account, specify to use the above directory
sudo passwd user-ftp1 #设置密码
sudo vim/etc/vsftpd.conf #修改配置文件
Userlist_deny=no
Userlist_enable=yes
Userlist_file=/etc/allowed_users
Local_enable=yes
Write_enable=yes
Local_root=/home/user-ftp1
#強制登入后的目錄
Chroot_local_user=yes
#登录后轉跳到指定目錄
Chroot_list_enable=yes
#yes: Activate Unrestricted list no: Activate restricted name
Chroot_list_file=/etc/vsftpd.chroot_list
#受限用戶清單存放位置
sudo vim/etc/allowed_users #添加用户名ftp-account
sudo vim/etc/ftpusers #此文件中是不能访问的用户清单, delete if available
sudo vim/etc/vsftpd.chroot_list #限定登入后目錄的用戶清單
sudo systemctl restart vsftpd #重启vsftpd服务
Ubuntu16.04 FTP Server Full Chapter