docker-vsftpd
docker-vsftpd copied to clipboard
Don't overwrite etc/vsftpd/virtual_users.txt on startup
tl;dr Change
echo -e "${FTP_USER}\n${FTP_PASS}" > /etc/vsftpd/virtual_users.txt
to
echo -e "${FTP_USER}\n${FTP_PASS}" >> /etc/vsftpd/virtual_users.txt
https://github.com/fauria/docker-vsftpd/blob/e5544259e6edc4a4c12fbe42023f5ff54c5f775e/run-vsftpd.sh#L24
It would be nice to be able to use this image as base image, and add an existing list of users when the we build the new image.
Example Docker File:
FROM fauria/vsftpd
COPY my-users.txt /etc/vsftpd/virtual_users.txt
Example my-users.txt.
myuser1
mypass1
myuser2
mypass2
Thank you, Lance
Agreed. It seems like an inconsistent behaviour.
This script would have been better
if ! grep -Fxq "${FTP_USER}" /etc/vsftpd/virtual_users.txt
then
echo -e "${FTP_USER}\n${FTP_PASS}" >> /etc/vsftpd/virtual_users.txt
fi
To avoid specifying duplicate entries, especially when someone decides to mount virtual_users.txt to host.
virtual_users 文件不应该和vsftpd.conf 在相同的目录。当容器被删掉后,virtual_users将不会被保留。如果将/etc/vsftpd/挂载出来,将导致默认配置丢失。virtual_users的目录应该是独立的。