Howto Samba
install docker
first we need to install docker and docker compose:
https://wiki.vidalinux.org/index.php/Howto_docker
deploy samba container
clone the following repo from github:
git clone https://github.com/vidalinux/docker.git
enter docker-samba directory:
cd docker/docker-samba
create docker container with script:
chmod +x build ./build
if everthing run fine you should see the image:
docker images|grep samba
if you want to change container parameters you need to edit docker-compose.yml file:
vi docker-compose.yml
deploy samba container using docker-compose:
docker-compose up -d
if container start fine you should see the container:
docker ps|grep samba_server
view containers deployment log using this command:
docker-compose logs -f
show the samba share name with the following commmand:
smbclient -L localhost
output results for this command:
lpcfg_do_global_parameter: WARNING: The "encrypt passwords" option is deprecated Password for [WORKGROUP\root]: Anonymous login successful Sharename Type Comment --------- ---- ------- share Disk samba share IPC$ IPC IPC Service (Samba Server) SMB1 disabled -- no workgroup available
mount share on linux command line:
mkdir /mnt/samba mount -t cifs -o username=samba,password=mysambapass //localhost/share /mnt/samba
mount samba share at boot time, edit fstab and add the following line:
//localhost/share /mnt/samba cifs defaults,username=samba,password=mysambapass 0 0
reload systemctl daemon:
systemctl daemon-reload
execute the following command to verify configuration:
mount -a mount |grep samba
if everything is good you should see the following output:
//localhost/share on /mnt/samba type cifs (rw,relatime,vers=3.1.1,cache=strict,username=samba,uid=0,noforceuid,gid=0,noforcegid,addr=127.0.0.1,file_mode=0755,dir_mode=0755,soft,nounix,serverino,mapposix,rsize=4194304,wsize=4194304,bsize=1048576,echo_interval=60,actimeo=1,closetimeo=1)