Build a Powerful Samba Server Using Raspberry Pi 2

There is a cheap way to build a powerful samba server at home. Personally, I love Raspberry Pi, a card size computer with ARM processor. Its powerful enough to be a samba server for my home network. Raspberry Pi 2 is very easy to setup, you can read our previous tutorial to install Raspbian 9 Stretch on Raspberry Pi. Its also worth it to read the important things to do after install Raspbian 9.

There are few steps to build Samba Server Using Raspberry Pi. The following steps will guide you through it.

Steps to Build a Powerful Samba Server Using Raspberry Pi

Step 1. Install Raspbian

Step 2. Install Samba on Raspbian

Connect to your Raspbian via SSH, or if you have direct access to your Raspberry, you can simply open Terminal and execute the following command to install Samba package.

sudo apt update && sudo apt upgrade
sudo apt install samba smbclient

Output sample:

pi@raspberrypi:/tmp $ sudo apt install samba
Reading package lists... Done
Building dependency tree 
Reading state information... Done
The following additional packages will be installed:
 attr libaio1 libfile-copy-recursive-perl python-dnspython python-ldb python-samba
 python-tdb samba-common-bin samba-dsdb-modules samba-vfs-modules tdb-tools update-inetd
Suggested packages:
 python-gpgme bind9 bind9utils ctdb ldb-tools ntp | chrony smbldap-tools winbind ufw
 heimdal-clients
The following NEW packages will be installed:
 attr libaio1 libfile-copy-recursive-perl python-dnspython python-ldb python-samba
 python-tdb samba samba-common-bin samba-dsdb-modules samba-vfs-modules tdb-tools
 update-inetd
0 upgraded, 13 newly installed, 0 to remove and 0 not upgraded.
Need to get 3,469 kB of archives.
After this operation, 23.7 MB of additional disk space will be used.
Do you want to continue? [Y/n]

Step 3. Configure Samba

Once you have Samba package installed, we can start configure it. First, lets create a new shared directory. For example, I am going to create a new directory /media/shares. This directory will be shared over samba on the network.

sudo mkdir /media/shares
sudo chmod -R 777 /media/shares

Edit Samba configuration file

sudo nano /etc/samba/smb.conf

Now, add the following lines to the end of the smb.conf file.

[Raspberry]
comment = Raspberry Pi Shared Folder
path = /media/Shares
browseable = yes
guest ok = yes
writable = yes
create mask = 0777
directory mask = 0777
public = yes

The line will create a shared folder called Raspberry. You can modify it as you need. Next, close and restart samba service

sudo systemctl restart smbd

Step 3. Create Samba User

On a default installation of Raspbian, you will only have one user called pi. We need to give access to our Samba resources for pi. Use this command to add pi to Samba user.

sudo smbpasswd -a pi

You will be asked to enter new Samba password for user pi.

Done. Now you can connect to your Raspberry Pi Samba server from other computer. If you are running Windows, open Explorer and type the Pi’s IP address for example:

\\192.168.100.10\Raspberry

Be the first to comment

Leave a Reply

Your email address will not be published.


*