The standard Windows interoperability suite of programs for Linux and Unix
135
Samba is the standard Windows interoperability suite of programs for Linux and Unix.
An USB flash drive is mounted at /mnt/usb.
# /etc/systemd/system/mnt-usb.mount
[Unit]
Description=USB Storage Mount
[Mount]
What=/dev/disk/by-uuid/829B-2038
Where=/mnt/usb
[Install]
WantedBy=local-fs.target
[global]
netbios name = easypi
workgroup = WORKGROUP
server string = EasyPi Samba Server
server role = standalone
map to guest = bad user
usershare allow guests = yes
[homes]
comment = Home Directories
browseable = no
writable = yes
[share]
comment = Public File Sharing
path = /share
browseable = yes
read only = no
guest ok = yes
admin users = root
$ cd ~/fig/samba
$ mkdir -m 777 -p data/{etc,log,mnt,var/private}
$ touch data/mnt/README.txt
$ docker compose up -d
$ docker compose exec samba sh
>>> testparm
>>> smbpasswd -a root
New SMB password:******
Retype new SMB password:******
Added user root.
>>> adduser -S -D -H -s /sbin/nologin kev
>>> smbpasswd -a kev
New SMB password:******
Retype new SMB password:******
Added user kev.
>>> smbpasswd -x kev
Deleted user kev.
>>> smbstatus
>>> smbcontrol smbd close-share "*"
>>> smbcontrol smbd kill-client-ip x.x.x.x
>>> ls -ld /share
drwxrwxrwx 3 1000 1000 /share
>>> exit
Tip
Use your own mounting point for sharing (e.g., /mnt/usb)
$ smbutil view -NG smb://easypi
Share Type Comments
-------------------------------
share Disk
IPC$ Pipe IPC Service (Samba Server)
2 shares listed
$ mkdir -p /Volumes/share
$ mount_smbfs //guest@easypi/share /Volumes/share
$ umount /Volumes/share
rootuser can read and write,guesthas the same perm as nobody
gpedit.msc, and select Edit group policy.Computer Configuration\Administrative Templates\Network\Lanman Workstation.Enable insecure guest logons, select Enabled, then select OK.Content type
Image
Digest
sha256:91b2297c4…
Size
23.1 MB
Last updated
about 15 hours ago
docker pull easypi/samba