How to install Samba on Raspberry Pi 3 with Raspbian Jessie Lite

Last week, I decided to buy one Raspberry Pi 3, and try to connect it to my Fuelino Proto3, in order to program it (using Arduino) and extend it with Wireless (Wi-Fi) feature. I am still new to Raspberry Pi, and I am interested to use it to write and compile C/C++ programs and run them in background, to provide connectivity with a Laptop PC or iPhone. I don't need a nice graphics interface, so I decided to install the simple and light Raspbian Jessie Lite on a 16GB Micro SD card (I guess 4GB or 8GB is also OK).

After writing Raspbian Jessie on the Micro SD card (using Win32DiskImager), I put in the card, and connected: micro USB power supply, HDMI, Ethernet cable, and Logitech wireless keyboard, then turned on the power.

The setup was pretty easy. Just log-in (username: "pi", password: "raspberry"), then run "sudo raspi-config" to: extend partition, activate SSH, disable Serial. After that, "sudo shutdown -r now" to restart.

After rebooting, you don't need the monitor and the keyboard anymore, so it is possible to detach them. Only Ethernet cable and micro USB power are needed. In order to connect to Raspberry Pi using SSH, I used a client called Putty. You can easily find the IP address by running "ifconfig" on the Pi (before detaching the HDMI monitor), but since I already removed the monitor, I decided to use the free "Advanced IP Scanner" on Windows.

Since I wanted to access the files of the Raspberry Pi using my Windows PC, and use Raspberry Pi in "headless mode" (= no monitor, remotely controlled), I installed Samba. Samba allows to access files stored on Linux, from Windows PCs. I created a guide with many screenshots, please download it here: samba_raspberry_pi_3_jessie. The basic steps are as following. First, connect using Putty (SSH port 22).

Then, type the following lines, one after the other. To quickly write them on Putty, you can just copy one line and then right click on Putty. It will paste the command for you.

sudo apt-get update
sudo apt-get install samba samba-common-bin
sudo nano /etc/samba/smb.conf

In the file, you need to make some modifications. You need to set the “workgroup” (in my case I set “PIPPO”), and un-comment (remove "#") “wins support = yes”. In the “Authentication” field, write “security = user”. At the end of the file, write as below.

comment=Raspberry Pi Share
only guest=no
create mask=0777
directory mask=0777

Then close and save the file by pressing "CTRL + X" and "Y".

sudo smbpasswd –a pi

Set the password, for example "raspberry". This is the password that Windows will ask you, when connecting to the folder. Then restart Samba.

sudo /etc/init.d/samba restart

Just to make sure (but probably not needed), restart the Pi by typing:

sudo shutdown -r now

Now you should be able to access the Raspberry Pi folders remotely.

All detailed steps are available in this PDF guide: samba_raspberry_pi_3_jessie.

Author: Davide Cavaliere

I am an Italian Electrical Engineer graduated at Politecnico di Milano. My interests are motorcycles and cars, electronics, programming, Internet of Things, and Japanese culture.

3 thoughts on “How to install Samba on Raspberry Pi 3 with Raspbian Jessie Lite”

  1. I'm afraid you missed one vital step that throws up an incomprehensible (for a non-Linux person) error.
    There is no "/home/pi/share" folder so Samba crashes.
    So this much be created before restarting Samba.

    Other than that a great how-to 🙂


  2. Great looking guides which I will be trying out as soon as I can.

    However, what would you need to do in order to get a Pi using Raspbian to be able to access a folder on a network storage device (such as a Western Digital My Book Live)?

Leave a Reply

Your email address will not be published. Required fields are marked *