fauria / docker-vsftpd

🐳 vsftpd Docker image based on Centos 7. Supports passive mode and virtual users.
https://hub.docker.com/r/fauria/vsftpd/
Apache License 2.0
414 stars 341 forks source link

can not login with new add FTP user #17

Closed happytimor closed 5 years ago

happytimor commented 6 years ago

i tried add a new ftp user,but login failed

finallly , i find the solution

# 4) Manually add a new FTP user to an existing container:
docker exec -i -t vsftpd bash
mkdir /home/vsftpd/myuser
chown -R ftp:ftp /home/vsftpd
echo -e "myuser\nmypass" >> /etc/vsftpd/virtual_users.txt
/usr/bin/db_load -T -t hash -f /etc/vsftpd/virtual_users.txt /etc/vsftpd/virtual_users.db
exit
docker restart vsftpd

you should add chown -R ftp:ftp /home/vsftpd command

fauria commented 5 years ago

Owners set on Dockerfile.

mrigi commented 5 years ago

Hey, "chown -R ftp:ftp /home/vsftpd" is absolutely unacceptable. Just imagine someone mount a whole volume to a /home/vsftpd/{SOME_USER} and you override all the rights inside. What? Why?! If for example you add ftp access to web root and override owner this brutal way most web sites will be completely broken. Never do that recursive chown. Fix ASAP plz.