docker-pure-ftpd icon indicating copy to clipboard operation
docker-pure-ftpd copied to clipboard

Cannot list directory when new user added.

Open sniperwolf88 opened this issue 2 years ago • 1 comments

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.

sniperwolf88 avatar Mar 18 '23 20:03 sniperwolf88

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

stilliard avatar Mar 25 '23 22:03 stilliard