-
Notifications
You must be signed in to change notification settings - Fork 2
Share folder with Samba
In this Raspberry Pi Samba tutorial, we will be showing you how you can share directories from your RPi using a Samba server.
This way, you will be able to explore files in your RPi from your local OS file explorer.
✔️ Linux
✔️ Windows
✔️ MacOS
Use a remote terminal via SSH to write command on the RPi (see SSH tutorial).
-
Update all apt packages
sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade
-
Install Samba packages
sudo apt-get install samba samba-common-bin
If asked to activate
Winds
, accept -
Backup the Samba config file.
Thesmb.conf
configuration file is where you will store all your settings for your shares folders.
For security (an accident happened quickly), copy the config file with this commandsudo cp /etc/samba/smb.conf /etc/samba/smb.conf_copy
-
Open the Samba config file with
nano
sudo nano /etc/samba/smb.conf
-
Modify the Samba config file
Within this file, modify the following parameters under the[homes]
sectionbrowseable = yes read only = no create mask = 0777 directory mask = 0777
Save and quit file (
CTRL
+X
thenY
followed byENTER
) -
Add a user
Next, we need to set up a user for our Samba share on the RPi. Without it, we won’t be able to make a connection to the shared network drive.
We will be creating a Samba user calledpi
with the password set toraspberry
(as default).
Run the following command then enter the password.sudo smbpasswd -a pi
-
Restart Samba
sudo systemctl restart smbd
- Open
File Explorer
- Go in
This PC
- Under
Computer
tab, clickMap network drive
- Under
Folder
enter\\raspberrypi\homes
- Select
Connect using different credentials
- Finish
- Enter the network credentials created previously (
pi
andraspberry
) - The new shared folder corresponding to the
home/pi
folder of the RPi must appear in File Explorer.
- Home
-
Hardware
- Car
- SBC
- Sensor
- Battery
-
RPi installation
- Start / Stop / Connect to RPi
- Raspian
- WiFi
- Remote coding via SSH (with key)
- VNC Viewer
- Share folder with Samba
- Bluetooth Controller
- OpenCV
- Program structure
- Road tracking
- Traffic sign detection
- Obstacle detection