Git Product home page Git Product logo

Comments (12)

daiaji avatar daiaji commented on July 18, 2024 1

I've changed the Samba user to root, and it seems to be working.

from samba.

MarvAmBass avatar MarvAmBass commented on July 18, 2024

Hi there, I'd say the problem is by creating a user and giving him the already taken userid of root - use a userid from the user range.

So there seems to be a permission problem. just try the following: create a new folder for this test, configure a user with a userid from the user range using the ACCOUNT_test and UID_test.

you can set permissions to this folder from inside podman (don't know if it also has a exec -ti like feature) if the folder is owned by your testuser it should work. or you edit the permissions from outside your container.

from samba.

daiaji avatar daiaji commented on July 18, 2024

I tried chown 1000 /shares/public, and after doing so, it seems to be able to upload normally. But in fact, the original owner of the /shares/public file is root, which may be the reason why it cannot be written. I am not particularly clear about the permission management of docker.

I set the Samba user to root, and the log appears to show that the UID of the Samba user has changed to 0, but that looks dangerous.

Considering that containers running in Podman rootless mode actually work primarily on root in the container, and that changing the folder owner can cause file owners outside the container to become abnormal, it might be necessary to use root as the Samba user, but are there any other security measures?

from samba.

MarvAmBass avatar MarvAmBass commented on July 18, 2024

thats a good point, I remember that some container runtimes might use randomized uuids for running inside the container, maybe that's the case with podman.

ahhh so you use the rootless mode? isn't this the mode with the randomized uids?

from the docker world if you mount a volume from outside the permissions will not automatically change with the mount - so if you want to write from within the docker container to the volume you need to make sure to have the appropriate access rights

from samba.

daiaji avatar daiaji commented on July 18, 2024

Podman rootless mode basically maps the root user in the container to the running user running Podman, but using other users in the container will be mapped to a UID greater than 10000.
I do not know the specific user UID mapping rule.

from samba.

MarvAmBass avatar MarvAmBass commented on July 18, 2024

can you check if it works without this rootless mode?

from samba.

MarvAmBass avatar MarvAmBass commented on July 18, 2024

I'll close this issue then

from samba.

daiaji avatar daiaji commented on July 18, 2024

Excuse me, is it possible to perform user mapping in samba?

from samba.

MarvAmBass avatar MarvAmBass commented on July 18, 2024

yes it is - and usually the way to go :) you can have a very complicated setup to map different samba users to another linux user, or enforce the group which is used to create objects in a certain share etc.

to check what you need take a look at samba docs.

also this issue might help you a lot ;) #45

from samba.

daiaji avatar daiaji commented on July 18, 2024

Can you provide user-mapped variables in the script? This seems to be a lot more convenient.

from samba.

MarvAmBass avatar MarvAmBass commented on July 18, 2024

it's already possible to use env variables to configure all that, take a look at the readme etc.

from samba.

daiaji avatar daiaji commented on July 18, 2024

It seems that the username map key value can only be a file path, which means I need to mount /etc/samba/usermap.txt additionally?

from samba.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.