Operations 3 min read

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).

Liangxu Linux
Liangxu Linux
Liangxu Linux
Step‑by‑Step Guide to Set Up a Samba File Share Between Linux and Windows

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 samba

Create shared directory

# mkdir /mnt/svr3

Create Samba user

# smbpasswd wyg

Alternatively: # 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 = wyg

Start the service

# systemctl start smb.service

Open 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

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

LinuxWindowsfile sharingSamba
Liangxu Linux
Written by

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.)

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.