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

Permissions bug #48

Closed
ghost opened this issue Mar 21, 2017 · 4 comments
Closed

Permissions bug #48

ghost opened this issue Mar 21, 2017 · 4 comments
Assignees

Comments

@ghost
Copy link

ghost commented Mar 21, 2017

I create a container with the root;root;0;0 key in order to assign ROOT user and ROOT group the new files.

docker run --rm -itd --net=host --name samba -v volume:/data/volume dperson/samba -n -u "root;root;0;0" -s "docker;/data;yes;no;no;all;root"

but when I create a file on a share, the permissions are

-rw-rw-r-- 1 root users    0 Mar 21 21:30 file.txt

how can I set the group to ROOT ?

Thank!

@dperson dperson self-assigned this Mar 21, 2017
@dperson
Copy link
Owner

dperson commented Mar 21, 2017

This container is a way to quickly and easily setup a simple share. All files are setup to be owned by one user and group (less to synchronize with the docker host). To set the UID and GID set the USERID and GROUPID environment variables. Just set them both to 0 and you should get the results that you want. Hope that helps.

@dperson dperson closed this as completed Mar 21, 2017
@ghost
Copy link
Author

ghost commented Mar 21, 2017

It worked! I just thought -e GROUPID=0 -e USERID=0 is equal to -u "root;root;0;0"

@koheiio
Copy link

koheiio commented Apr 12, 2017

Wait I'm curious: what exactly is the difference between the userid and groupid in -u and in the environment variables USERID and GROUPID?

@dperson
Copy link
Owner

dperson commented Apr 24, 2017

@htkoca sorry for the slow reply, I was out of town on vacation.

The -u flag will create a user on the system, for simple authentication needs.

Because this container is designed to be a simple and easy way to share a directory of files, it skips many more advanced features of samba and AD. All file access takes place as the smbuser user and group users. The USERID and GROUPID environment variables will be used for the smbuser and users user/group in the container.

This prevents most permission issues, also as users created in the container won't be created on the host running docker, there are fewer random IDs to deal with there. If you set USERID and GROUPID to a valid user on the docker server, the files will be owned by that user/group.

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

2 participants