Skip to content

[Procedure] Install Samba to share files with Windows

Éric Massé edited this page Mar 15, 2015 · 1 revision

References:

Required:


#Step 1 – Install samba

You can share your Raspberry Pi's files and folders across a network using a piece of software called Samba, a Linux implementation of the Server Message Block protocol.

sudo apt-get install samba samba-common-bin

#Step 2 – Configure samba

Samba contains the SMB protocol, support for the Windows naming service (WINS), and support for joining Windows workgroups. A workgroup is a group of computers on a local network that can access eachother's folders. Samba-common-bin contains a tool that you'll need to register users with Samba. Once these packages have finished installing, you need to edit the Samba configuration file.

sudoedit /etc/samba/smb.conf

Find the entries for workgroup and wins support, and set them up as follows:

workgroup = WORKGROUP
wins support = yes

The name of the workgroup can be anything you want, as long as it only contains alphabetical characters, and it matches the name of the workgroup that you want to join.

You also need to add the following section of code at the end of the file. Scroll down smb.conf until you see a section called Share Definitions, and add this code there. The path should point to the drive or folder that you want to share.

#============================ Share Definitions ==============================
[WdMyCloud]
path = /media/wdmycloud
browsable =yes
writable = yes
guest ok = yes
read only = no

WdMyCloud is a name for the configuration

/media/wdmycloud is the path of the folder you want to share

Step 3 - Set password

Now type this command in a terminal, and enter pi's password twice:

smbpasswd -a pi

If you have a PC or laptop connected to your workgroup, you should be able to see your Raspberry Pi in Windows Explorer under Network.