stilliard / docker-pure-ftpd

Docker Pure-ftpd Server
https://hub.docker.com/r/stilliard/pure-ftpd/
MIT License
857 stars 325 forks source link

Cannot list directory when new user added. #188

Open sniperwolf88 opened 1 year ago

sniperwolf88 commented 1 year ago

I followed the steps to run ftp in docker using docker compose, but when I create an extra user with the command:

pure-pw useradd USER -f /etc/pure-ftpd/passwd/pureftpd.passwd -m -u ftpuser -d /home/ftpusers/USER

It creates the user and writes the information in the pureftpd.passwd file, but it doesn't create the directory for the user. I tried multiple ways, including matching the id and gid with the volume where I have mapped persistent files, but I was unsuccessful. The ftp client always returned that the directory was inaccessible. Apparently and as I could confirm, the directory is not created after executing the command inside the container.

The only way I could solve it was by running:

docker exec -it pure-ftpd-1 pure-pw useradd USER -f /etc/pure-ftpd/passwd/pureftpd.passwd -m -u 1500 -g 1500 -d /home/ftpusers/USER

And then on the docker host, where I have mapped the data volume, with the user with id 1500 and gid 1500:

mkdir /home/apps/production/docker/pure-ftpd/pure-ftpd-1/data/USER

This way, I was able to make everything work.

stilliard commented 1 year ago

Hi @sniperwolf88 Would it work if you created their home folder first? Looking over our run.sh file that looks to be how we do it too: https://github.com/stilliard/docker-pure-ftpd/blob/master/run.sh#L61