Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation: Document the needed access rights to apply to the mounted home folder for a user #35

Closed
OhmegaStar opened this issue Mar 30, 2017 · 8 comments

Comments

@OhmegaStar
Copy link

Hi,

I've created a ftp server, mounted a folder in my docker host as the /home/ftpusers directory

I ran the
a folder has been created there for the user by this command (a .sh script):
pure-pw useradd $1 -f /etc/pure-ftpd/passwd/pureftpd.passwd -m -u ftpuser -d /home/ftpusers/$1

the directory was created. The user cannot upload any files to the home folder (access denied).. i guess theres something wrong with the access the the folder (is created by root):
drwxr-xr-x 2 root root 4096 Mar 30 14:07 testuser

???????

Hope for some help

/OhmegaStar

@stilliard
Copy link
Owner

Hi @OhmegaStar ,
Sorry for my delayed reply, have you found any answers around this?

I've not run into any user permission issues yet myself, but it might be an issue outside this docker image. Is this of any use to you? https://denibertovic.com/posts/handling-permissions-with-docker-volumes/

@OhmegaStar
Copy link
Author

Hi @stilliard
thanks for answering & asking.

Yes, it seems it's an issue with setting the UID/GID of the ftp user so it matches a UID/GID on the host servicing the docker image / the mounted folder.

It would be nice if the UID/GID of the ftpuser could be configured as an env var to the image / or alternatively to:
pure-pw useradd $1 -f /etc/pure-ftpd/passwd/pureftpd.passwd -m -u ftpuser -d /home/ftpusers/$1
oh - and it seems you can:
pure-pw useradd test-user -u 1234 -g 1234 -d /path/to/my/dir

then maybe a documentation update is all that is needed ??

/OhmegaStar

@stilliard
Copy link
Owner

Ah sure that makes sense.
I'll update the docs for this shortly thank you!

@marcoskichel
Copy link

Hello guys,
How do I find out the -u and -g parameter to use in this scenario?

Thanks

@OhmegaStar
Copy link
Author

@marcoskichel you would have to look at the docker host that has the folder that is mounted into the docker image, that folder will have user & group access information, that can then be translated into the numerical values you need. the translation probably depends some on the *nix flavor you run on the host server.
/OhmegaStar

@fjarcticfox
Copy link

/# pure-pw useradd www -f /etc/pure-ftpd/passwd/pureftpd.passwd -m -u root -g root -d /home/ftpusers/www
You must give (non-root) uid and gid
Unable to open the passwd file: No such file or directory

@kevincaradant
Copy link

kevincaradant commented Dec 27, 2017

Same problem, I can't figure out it for now

Edit: Ok I got it, you have to specify the -u (for uid) and -g (for gid) number. Choose one that you want but not the 0 which is for the root. I hope that will fix your issue @fjarcticfox

@ihmcjacky
Copy link

/# pure-pw useradd www -f /etc/pure-ftpd/passwd/pureftpd.passwd -m -u root -g root -d /home/ftpusers/www You must give (non-root) uid and gid Unable to open the passwd file: No such file or directory

What if the host that has the folder is owned by root? like named volumes located in /var/lib/docker/volumes ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants