Step‑by‑Step Guide to Set Up a Samba File Share Between Linux and Windows
This tutorial walks through configuring a Linux server (192.168.2.251) with Samba, creating a shared directory, adding a Samba user, adjusting firewall and SELinux settings, testing the share from Linux, and finally connecting and mapping the share from a Windows client (192.168.2.252).
1. Service Structure
Server side: Linux server 192.168.2.251; client side: Windows server 192.168.2.252.
2. Deploy Samba on Linux
Install Samba
# yum -y install sambaCreate shared directory
# mkdir /mnt/svr3Create Samba user
# smbpasswd wygAlternatively: # pdbedit -a -u test Password: wyg.123
Edit smb.conf
# vim /etc/samba/smb.conf
# Add the following share definition (keep existing global section unchanged)
[svr3]
comment = svr3
path = /mnt/svr1
public = no
writable = yes
write list = wyg
valid users = wygStart the service
# systemctl start smb.serviceOpen firewall / disable SELinux
Disable SELinux and either turn off the firewall or allow ports 445 and 139.
Test the connection from Linux
# smbclient -U wyg //192.168.17.251/svr3
Enter SAMBA\wug's password:
... (use "exit" to quit)3. Connect from Windows client
Test connection
Enter \\192.168.2.251\svr3 in File Explorer, provide user wyg and password wyg.123 to access the share.
Add network mapping
Use Windows “Map Network Drive” to permanently map the share.
Link: https://www.cnblogs.com/wangyuanguang/p/18166550
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Liangxu Linux
Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
