How to setup samba (windows file sharing) for Raspbian

sambaConnect to the raspberry by ssh or open a terminal window.

Enter the following in the terminal:

Login as sudo

sudo -s

Update your software

apt-get update && apt-get upgrade

Install samba

apt-get install samba samba-common-bin

Since I’m using it on a LAN i dont care about logins, so with the following configuration everyone (guest) is allowed to read and write on the share.

Configure your shares with:

vi /etc/samba/smb.conf

Put the following config in the file, at the end or where you want it, I dont care. Just make sure you delete everything under ========shares======== or something similar.


[Share name here]
comment = Share name here
path = path to your share location Ex. /media/usbdrive1
writeable = yes
guest ok = yes
guest only = no
create mask = 0777
directory mask = 0777
browseable = yes
public = yes
read only = no

Let’s restart the service to make it work

/etc/init.d/samba restart

Sidebar