Coder Social home page Coder Social logo

docker-samba's Introduction

Samba for Docker

This runs a basic samba server underneath docker with a number of limitations and constraints.

This supports a tdb backend and unix users. Unix users are managed via a dedicated set of files for passwd/shadow/group.

Configuring

These Docker containers must be configured so that you may have users and working shares.

Share Paths (Docker)

It is necessary to tell Docker which directories on the host may be shared into the container. If these directories were not visible to the container, Samba would be unable to expose these shares to the network.

Edit etc/defaults/docker to set your share paths:

SHARE_DIR=/path/to/files/all/users/can/see
GUEST_DIR=/path/to/files/all/guests/can/see
HOME_DIR=/home

These will all be bind-mounted to the samba-smbd container, there is presently no way to disable any of these mounts. To disable a share path, point it to an empty directory, edit smb.conf, or edit launch.sh; Ideally, edit smb.conf and launch.sh both.

Samba Shares & Configuration

The default samba configuration should serve for very basic needs within the constraints of what is possible and reasonable within a Docker environment.

Still, it is likely that you'll want to change the configuration.

Edit etc/smb/smb.conf as desired and relaunch your containers.

Users

User management is performed through tdb and standard Unix password/shadow files. Edit these files within the etc/ directory and relaunch your containers.

For convenience, a user management tool is available as:

$ ./docker-samba usermod [add|delete|password] <user> <password>

The password option is mandatory for 'add' and 'password'. If supplied, the password is ignored for the 'delete' feature.

Running

$ ./docker-samba build
$ ./docker-samba launch

The build process should only need to be performed once, unless code changes have been made or an upgrade is being performed.

These commands MUST be run as root, or with a user granted priviledges to build and launch docker containers.

docker-samba's People

Contributors

ewindisch avatar tomislacker avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

docker-samba's Issues

Running step on README

Please, change the instruction:

$ ./samba-docker build

to

$ ./docker-samba build

Thank you.

Usermod causes failed to open secrets.tdb due to missing directory

I get: "Failed to open /var/lib/samba/private/secrets.tdb"
when trying to do usermod add. I see that ./var/lib/samba exists but not ./var/lib/samba/private. Making that directory first seems to work. Suggest touching a .empty file in that dir and adding it to git?

Also, your readme.md says samba-docker, but the command is docker-samba.

Exits as soon as it has started

The containers exit immediately after starting with ./docker-samba launch

The log output is:

smbd version 4.3.9-Ubuntu started.
Copyright Andrew Tridgell and the Samba Team 1992-2015
STATUS=daemon 'smbd' finished starting up and ready to serve connections
nmbd version 4.3.9-Ubuntu started.
Copyright Andrew Tridgell and the Samba Team 1992-2015
STATUS=daemon 'nmbd' finished starting up and ready to serve connections
EOF on stdin
Got SIGTERM: going down...

Running the container manually not in daemon mode works docker run --rm -it -v $PWD/etc/samba:/etc/samba ewindisch/samba-nmbd $@ but this is less than ideal.

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.