Setting up Samba on Raspberry Pi

5

Samba is a program that shares files from a Linux computer on a Windows network. It works great on the Raspberry Pi and is the easiest way to transfer files to your Pi from a windows computer. This tutorial will describe how to setup Samba on Raspbian.


The first thing we need to do is install Samba. Open up a terminal on your Pi or SSH into it. and type the following commands to get Samba.

Now lets create a folder and give ownership to it to the pi user.

Time to set up Samba. We need to edit the smb.conf file.

You can change the workgroup if you need to, but I will leave it as WORKGROUP. Scroll down until you see

Uncomment it and change it to

Now, go to the very bottom of the file and add the following

You can also comment out the printer share near the bottom if you want, but it is not necessary. Save the file and close it using Ctrl + x, y, enter.

We need to add our user to samba and give it a password. I will use the default pi username.

Enter your password twice. Now we need to restart samba. Doing this has changed from Wheezy to Jessie. For wheezy it was just sudo service samba restart, for the newest release, Jessie enter:

Now, your share should be available on your network. You will have to log in to the share with the username pi (or whatever you set up), and the password you setup for samba.

That is it.

Share.

About Author

I love to tinker, code, and create electronics. I primarily focus on Raspberry Pi (and other linux SBCs) and Arduino (and other microcontrollers that run on the Arduino platform).

  • I do not have anything in my smb.conf that says wins support. Please advise.

    • If it is not there, you can just add the line and it should work.

  • K_Piterskiy

    Thank you, my Pi samba server working!

  • Gary

    Thank you – it worked perfectly first time.

  • JoeSpur

    Thank you, it worked fantastically!