Introduction
Today, I will discuss how to set up <span>Samba</span>
on Raspberry Pi for file sharing.
Installation
sudo pacman -S samba
The configuration file is located at <span>/etc/samba/smb.conf</span>
, but when you check this path, you will find it is empty.
After searching for a while, I finally found a solution in Using Samba on Manjaro for Cross-System File Sharing in Local Area Network – JianShu[1]. You need to install <span>manjaro=settings-samba</span>
sudo pacman -S manjaro-settings-samba
Once installed, it will be available.
Add User
sudo smbpasswd -a xxx # Create a user
Note that if the user does not exist on your computer, you cannot add them successfully. For example, if you use <span>test</span>
, it will report the following error.
sudo smbpasswd -a test
New SMB password:
Retype new SMB password:
Failed to add entry for user test.
If you are not sure which users exist on the system, you can check with the following command:
cat /etc/passwd
Add New User
If you want to add a new user, you can create a new group and then add the new user.
sudo groupadd test1 -g 6000 # Create test1 user group
sudo useradd test1 -u 6000 -g 6000 -s /sbin/nologin -d /dev/null # Add test1 to the test1 user group and set it to not allow login
At this point, you can use <span>smbpasswd -a test1</span>
to successfully add the user.
Configuration
Create a <span>share</span>
folder under <span>home</span>
for file sharing.
Open <span>/etc/samba/smb.conf</span>
and add the following content at the end. Modify the path according to your situation.
[shared]
comment = Samba Shared
path = /home/test/share
public = no
valid users = test
browseable = yes
writable = yes
create mask = 0777
directory mask = 0777
Connection
Once configured, you can start connecting.
For example, on a Mac, open <span>Finder</span>
and use the shortcut <span>cmd k</span>
to open the Connect to Server interface.
In the input box, enter <span>smb://ip</span>
, then select Connect, and enter the username and password to see the directory configured in <span>Samba</span>
.

Conclusion
<span>Samba</span>
can be quite complex with many configurations, but it is necessary for certain tasks, such as camera backups.
Using Samba on Manjaro for Cross-System File Sharing in Local Area Network – JianShu:https://www.jianshu.com/p/b0fcf29a857a
[2]dperson/samba: Samba docker container:https://github.com/dperson/samba
[3]Using Samba on Manjaro for Cross-System File Sharing in Local Area Network – JianShu:https://www.jianshu.com/p/b0fcf29a857a
[4][Problem Solving] Failed to add entry for user when adding user and password in Samba – CSDN Blog:https://blog.csdn.net/p1279030826/article/details/111409106
Previous Recommendations
Pengpai OS2 and Mac Interconnection
Compressing Git Repository
DeepL Free Translation Version