82 [sw][linux] linux/windows samba file share
Step 1 - Linux smb server
# enable & start samba sersvice
sudo systemctl start smbd.service
sudo systemctl enable smbd.service
sudo systemctl start nmbd.service
sudo systemctl enable nmbd.service
# config share path
# net usershare add <sharename> <sharepath> "<sharedesc>" Everyone:F guest_ok=n
net usershare add share $HOME "home" Everyone:F guest_ok=n
## /etc/samba/smb.conf
[share]
path = /root
writable = yes
browsable = yes
public = yes
create mask = 0777
directory mask = 0777
force user = root
max connections = 10
[share]
path = /boot
writable = yes
browsable = yes
public = yes
create mask = 0777
directory mask = 0777
force user = root
max connections = 10
# if you want to access softlink, use `mount --bind` or `fstab` instead
cd /root
mkdir boot
mount --bind /boot /root/boot
Step 2 - Windows Client
- type\\<your linux ip>\<sharename> in windows explorer.
- map a network disk by net use Z: \\<server>\<shared folder> /user:<name> <pswd>
- use net use in cmd to list all connections
Comments
konosubakonoakua · 2024-09-23T16:58:09Z
linux mount windows shared
windows side
linux side
You may encounter mount read-only issue if cifs-utils is not installed.