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

Support to add local users to local groups #163

Open
git-developer opened this issue Dec 24, 2023 · 1 comment
Open

Support to add local users to local groups #163

git-developer opened this issue Dec 24, 2023 · 1 comment

Comments

@git-developer
Copy link

I'm evaluating if and how to migrate from a local samba installation to samba-container. It seems that most of my requirements are satisfied. I'm working with local users and groups, and I'm happy to see that both are supported sufficiently.

Unfortunately, the final piece of the puzzle is missing: adding local users to local groups.

Since this feature is quite important for me, I created a workaround by manually post-processing the /etc/group file between init and server start.

This workaround has become quite complicated because the components don't play well together:

  • Since I need to modify the group file, I'd like to mount it from the host.
  • samba-container's user configuration doesn't change the content of existing files /etc/passwd and /etc/group
    but creates new files and renames/moves them. This makes it impossible to bind mount these files.
    Fortunately, we have arguments --etc-passwd-path & --etc-group-path to relocate them to a directory that can be mounted from the host.
  • The users_passdb command ignores --etc-passwd-path & --etc-group-path and expects passwd and group in /etc.
    So the files have to be writable in some host-mounted directory and additionally readable in /etc.
    This can be managed either by 3 mounts or by a custom entrypoint that creates symlinks.
  • With this setup, it's not possible to combine initialization and server run,
    because the group file must be modified after user initialization and before server start.

I hope you understand that I'd like to avoid this situation.
So I'd like to ask if samba-container can be extended by support for adding users to groups.
The configuration could look like this:

users:
  all_entries:
    - name: alice
      uid: 1001
      gid: 1001
      password: foo
    - name: bob
      uid: 1002
      gid: 1002
      password: bar
groups:
  all_entries:
    - name: readers
      gid: 2000
      members: [ alice, bob ]
    - name: writers
      gid: 2001
      members: [ alice ]

Last but not least: Thanks for maintaining samba-container!

@phlogistonjohn
Copy link
Collaborator

Thank you for reporting this issue. I agree that we ought to support something like the yaml example you provided.

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