Sign inSign up

nickadam/smb-share

By nickadam

•Updated almost 5 years ago

Host an smb share with one user account

Image
0

402

nickadam/smb-share repository overview

⁠nickadam/smb-share

Simple container to host an smb share with one user account

Github repo⁠

⁠Examples

This will start an smb share, \data, on the host to a random docker volume. The username is admin and the randomly generated password is on the first line of the logs.

docker pull nickadam/smb-share
docker run -d --name myshare -p 445:445 -p 139:139 nickadam/smb-share
docker logs myshare

In this example we specify the username, password, and mount a local volume using the current users UID and GID.

docker run -d --name myshare \
  -p 445:445 -p 139:139 \
  -v "$PWD":/data \
  -e SMB_USER="$USERNAME" \
  -e PASSWORD="badpassword" \
  -e SMB_UID=$UID \
  -e SMB_GID=$GID \
  nickadam/smb-share

⁠Data directory

Persistent data shared from /data

If the data directory is empty, it will be chowned with the UID and GID of the SMB user.

⁠Ports

Expose ports 445 and 139

⁠Environment variables

NameValue if not specifiedDescription
SHARE_NAMEdataThe name of the share
SMB_USERadminThe username with permission to the share
PASSWORDA password will be randomly generated and displayed in the logs if not specified
PASSWORD_FILEPath to a file containing the plain text password, can be used instead of PASSWORD
SMB_UID1000The user id of the user
SMB_GID1000The group id of the user
FILEMODE644New files created via smb will have these permissions
DIRMODE755New directories created via smb will have these permissions

⁠Accessing the share from windows

To prevent windows from attempting to access the share with the local user or guest it's a good idea to use the net command to specify the user and password.

Prompt for password:

net use /user:admin "\\server.example.com\data"

Specify password:

net use /user:admin "\\server.example.com\data" badpassword

⁠More info

See docker-compose.yml⁠ for more info and docker swarm example

Tag summary

Content type

Image

Digest

Size

111.3 MB

Last updated

almost 5 years ago

docker pull nickadam/smb-share