Samba file sharing¶
Copyright © Quectel Wireless Solutions Co., Ltd. 2026. All rights reserved.
Overview¶
Samba is a commonly used tool for building file sharing and access control services on Linux systems. It uses the SMB protocol to enable file access between different devices within a local area network. By deploying Samba locally, you can easily provide shared directories to Windows, Linux, or macOS clients, enabling cross-platform file transfer and collaboration.
This document describes how to configure a Samba file sharing service on the Quectel Pi M2 Debian system so that a Windows computer can directly access the device’s shared folders.
Prerequisites¶
Confirm the device environment:
Quectel Pi M2 has booted into the Debian system
The Windows host and the device are on the same local area network with working network connectivity
M2 is verified under the GNOME graphical environment. Samba file sharing does not depend on the GNOME desktop.
Check network connectivity.Run the following command on the device to view the current IP address:
hostname -I
ping <board-IP>
Install Samba Service¶
Samba is a service program on Debian/Linux used for sharing files with Windows systems.
Update the package list:
sudo apt-get update
Install Samba and client tools:
sudo apt-get install -y samba smbclient
💡
samba: Server-side software for providing sharing services;smbclient: Client tool that can be used to test whether the connection is successful.
Confirm that Samba is installed successfully:
smbd --version
smbclient --version
Configure Samba Service¶
Open the configuration file:
sudo vim /etc/samba/smb.conf
sudo nano /etc/samba/smb.conf
Scroll to the end of the file and add the following content:
[myshare]
comment = My Shared Folder
browseable = yes
path = /home/q/share
create mask = 0664
directory mask = 0775
valid users = q
force user = q
force group = q
public = no
guest ok = no
writable = yes
available = yes
💡
[myshare]— The share name seen by Windows clients when accessing.path— The actual path of the shared directory.create mask / directory mask— Default permissions for newly created files/folders.valid users— Authorized users allowed to access the Samba server; the example user here isq; in actual use, replace it with the real user on the development board.writable = yes— Allows clients to create, modify, and delete files in this directory.
💡 If you need to allow anonymous access, use
public = yes; if you need to prevent anonymous/guest access, keeppublic = no, guest ok = no.
Check the Samba configuration file syntax:
testparm
Set Samba User and Password¶
The Samba login user must be an existing user in the system and requires a separate Samba access password. Using the system user q as an example:
sudo smbpasswd -a q
You will need to enter the password twice for confirmation (this password will be used when accessing from Windows).
Restart Samba Service to Apply Configuration¶
sudo systemctl restart smbd
sudo systemctl status smbd --no-pager -l
Set Samba to start automatically on boot:
sudo systemctl enable smbd
Check Port Listening¶
Samba primarily uses TCP port 445. After the service starts, run the following command to confirm whether the port is in a listening state:
ss -tulnp | grep -E ':445|:139'
If the device has a firewall enabled, allow TCP port 445 according to your actual firewall tool. When no firewall is enabled, no additional rules are needed.
View Device IP Address¶
Before accessing the device’s shared directory from Windows, you need to obtain the device IP address:
hostname -I
In actual use, use the IP address currently queried on the development board.