Giter Site home page Giter Site logo

debian-samba-dc's Introduction

Samba 4 AD container based on debian

Credits

Some parts are collected from:

Usage

Without any config and thrown away when terminated:

docker run -it --rm tkaefer/alpine-samba-ad-container

Environment variables

Environment variables are controlling the way how this image behaves therefore please check this list an explanation:

Variabale Explanation Default
SAMBA_DOMAIN The domain name used for Samba AD SAMDOM
SAMBA_REALM The realm for authentication (eg. Kerberos) SAMDOM.EXAMPLE.COM
LDAP_ALLOW_INSECURE Allow insecure LDAP setup, by using unecrypted password. Please use only in debug and non productive setups. false
SAMBA_ADMIN_PASSWORD The samba admin user password set to $(pwgen -cny 10 1)
KERBEROS_PASSWORD The kerberos password set to $(pwgen -cny 10 1)

Use existing data

Using (or reusing data) is done by providing

  • /etc/samba/smb.conf
  • /etc/krb5.conf
  • /usr/lib/samba/
  • /var/lib/krb5kdc/

as volumes to the docker container.

Example

Plain docker

touch /tmp/krb-conf/krb5.conf

docker run -d -e SAMBA_DOMAIN=TEST -e SAMBA_REALM=TEST.MYDOMAIN.COM -v /tmp/smb-conf:/etc/samba -v /tmp/krb-conf/krb5.conf:/etc/krb5.conf -v /tmp/smb-data:/var/lib/samba -v /tmp/krb-data:/var/lib/krb5kdc --name smb4ad tkaefer/alpine-samba-ad-container

For details how to store data in directories, containers etc. please check the Docker documentation for details.

Docker compose

Get the docker-compose.yaml file from the github repo. Copy it to an appropriate directory, do a touch /tmp/krb-conf/krb5.conf and run docker-compose up -d within that directory.

Watch the logs via docker-compose logs -f.

notes

Create clean volumes

if [ -d $HOME/tmp ]; then echo "Removing tmp dir"; rm -rf $HOME/tmp; fi; \
echo "Creating tmp dir" \
&& mkdir -p $HOME/tmp/krb-conf \
&& mkdir $HOME/tmp/krb-data \
&& mkdir $HOME/tmp/smb-conf \
&& touch $HOME/tmp/krb-conf/krb5.conf \
&& docker volume rm samba-data \
&& docker volume create samba-data

Run an instance

docker volume create samba-data

docker run -it --rm --cap-add SYS_ADMIN \
-e SAMBA_ADMIN_PASSWORD=...secr3t... \
-e SAMBA_DOMAIN=local \
-e SAMBA_REALM=local.patodiaz.io \
-e LDAP_ALLOW_INSECURE=true \
--mount type=bind,source=$HOME/tmp/krb-conf/krb5.conf,target=/etc/krb5.conf \
--mount type=bind,source=$HOME/tmp/krb-data,target=/var/lib/krb5kdc \
--mount type=bind,source=$HOME/tmp/smb-conf,target=/etc/samba \
--mount type=volume,source=samba-data,target=/var/lib/samba \
-p 389:389 \
--name smb4ad \
padiazg/samba4dc

debian-samba-dc's People

Watchers

 avatar

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.