Howto Samba: Difference between revisions
Mandulete1 (talk | contribs) |
Mandulete1 (talk | contribs) m (Protected "Howto Samba" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite))) |
||
(4 intermediate revisions by the same user not shown) | |||
Line 7: | Line 7: | ||
enter docker-samba directory: | enter docker-samba directory: | ||
cd docker/docker-samba | 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: | if you want to change container parameters you need to edit docker-compose.yml file: | ||
vi docker-compose.yml | vi docker-compose.yml | ||
deploy samba container using docker-compose: | deploy samba container using docker-compose: | ||
docker-compose up -d | 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: | view containers deployment log using this command: | ||
docker-compose logs -f | docker-compose logs -f | ||
= mount samba share = | = mount samba share = | ||
show the samba share name with the following commmand: | show the samba share name with the following commmand: | ||
smbclient -L localhost | smbclient -L localhost | ||
output results for this command: | output results for this command: | ||
lpcfg_do_global_parameter: WARNING: The "encrypt passwords" option is deprecated | lpcfg_do_global_parameter: WARNING: The "encrypt passwords" option is deprecated | ||
Password for [WORKGROUP\root]: | Password for [WORKGROUP\root]: | ||
Anonymous login successful | Anonymous login successful | ||
Line 29: | Line 37: | ||
mkdir /mnt/samba | mkdir /mnt/samba | ||
mount -t cifs -o username=samba,password=mysambapass //localhost/share /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) |
Latest revision as of 02:57, 9 January 2024
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)