docker-vsftpd icon indicating copy to clipboard operation
docker-vsftpd copied to clipboard

Don't overwrite etc/vsftpd/virtual_users.txt on startup

Open lancerushing opened this issue 6 years ago • 3 comments

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

lancerushing avatar Nov 07 '18 01:11 lancerushing

Agreed. It seems like an inconsistent behaviour.

AleksMeshkov avatar Apr 18 '19 16:04 AleksMeshkov

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.

gregory112 avatar Jun 07 '20 12:06 gregory112

virtual_users 文件不应该和vsftpd.conf 在相同的目录。当容器被删掉后,virtual_users将不会被保留。如果将/etc/vsftpd/挂载出来,将导致默认配置丢失。virtual_users的目录应该是独立的。

kycheng avatar Apr 01 '21 06:04 kycheng