1. 未学安装,先学卸载
apt remove –purge vsftpd
查看本地用户
root@santiagod-virtual-machine:~# tail -3 /etc/passwd santiagod:x:1000:1000:santiagod,,,:/home/santiagod:/bin/bash sshd:x:128:65534::/run/sshd:/usr/sbin/nologin mysql:x:129:136:MySQL Server,,,:/nonexistent:/bin/false
2. 装包
apt install-y vsftpd
3. 启动服务
systemctl start vsftpd
再次查看本地用户
root@santiagod-virtual-machine:~# tail -3 /etc/passwd sshd:x:128:65534::/run/sshd:/usr/sbin/nologin mysql:x:129:136:MySQL Server,,,:/nonexistent:/bin/false ftp:x:130:137:ftp daemon,,,:/srv/ftp:/usr/sbin/nologin
root@santiagod-virtual-machine:~# cat /etc/ftpusers # /etc/ftpusers: list of users disallowed FTP access. See ftpusers(5). root daemon bin sys sync games man lp mail news uucp nobody
4. 尝试修改ftp目录(默认:/srv/ftp),暂时失败
root@santiagod-virtual-machine:~# useradd -m myftp -d /home/myftp -s /sbin/nologin root@santiagod-virtual-machine:~# tail -1 /etc/vsftpd.conf local_root=/home/myftp root@santiagod-virtual-machine:~# tail -1 /etc/passwd myftp:x:1001:1001::/home/myftp:/sbin/nologin root@santiagod-virtual-machine:~# echo "myftp:myftp" |chpasswd BAD PASSWORD: The password is shorter than 8 characters root@santiagod-virtual-machine:~# echo "myftp:Admin@123" |chpasswd root@santiagod-virtual-machine:~# systemctl restart vsftpd
原创文章,作者:kirin,如若转载,请注明出处:https://blog.ytso.com/tech/aiops/270693.html