Samba is an open-source software suite that provides file and print services for Microsoft Windows clients. It is widely used in small and large organisations, and is known for its ease of use and flexibility. It is a popular choice for file and printer sharing, as it is free, open-source, and provides compatibility with a wide range of operating systems and devices.
To mount a Samba share on a Raspberry Pi, you need to have the cifs-utils
package installed.
sudo apt install cifs-utils -y
Now mount the Samba share:
sudo mount -t cifs //server-name/share-name /mnt/samba -o username=samba-user,password=samba-password
You can also use file to save Samba credentials in this format:
username=<username>
password=<password>
domain=<domain name> #(if any)
In this case, you need to run below command to mount the Samba share:
sudo mount -t cifs //server-name/share-name /mnt/samba -o credential=<full path of credential file>
To make the mount persistent across reboots, add the below line at the end of /etc/fstab
file:
//server-name/share-name /mnt/samba cifs credential=<full path of credential file> 0 0
By following these steps, you should be able to mount a Samba share on a Raspberry Pi and access its contents.