Raspberry Pi Samba Server Installation

Raspberry Pi Samba Server Installation

Raspberry Pi Samba Server Installation

 Hello friends, in this post I will talk about how you can access the files on your Raspberry device from another computer by installing a Samba server on your Raspberry device. Enjoy reading.

What is Samba?

First, for those who ask what a Samba Server is, let me explain it to you as follows: Samba Server is software developed for the Linux operating system that allows you to share and access files on your device either with local devices or over the internet.

Samba Server Installation

The installation methods here are the same for any Linux operating system. You can install it in the same way not only on Raspberry devices but also on any device using a Linux operating system.

First, let's check for updates on our device and install them.

sudo apt-get update
sudo apt-get upgrade

now we can move on to the installation. Run the code below for the installation and if you encounter any "Y/n" prompts, continue by pressing "Y".

sudo apt-get install samba samba-common-bin

Now, if we want to share a file we specify, we can create a file.

If you want to create a file, you can create a file with the code below. (If you do not want to create a file, you can skip this part.)

mkdir /home/pi/shared

Now that we have created our file, we need to enter the Samba settings and point to our file.

sudo nano /etc/samba/smb.conf

With the code above, let's open Samba's configuration file and insert the following section, adjusting it according to the name and location of the file we created above or according to the details of the file you want to share, and then save it.

[urhoba.net]
path = /home/pi/shared // this is the location of the file we are sharing.
writeable=Yes
create mask=0777
directory mask=0777
public=no

You need to do the above process for each file you want to share.

Note: You can save the file with ctrl + o and close the nano editor with ctrl + x.

Now, in order to access our Raspberry device from the device we connect from, we need to create a Samba account; for this, let's run the following code in the terminal

sudo smbpasswd -a pi

After this process, we can now access our file with the username "pi" and the current password of our Raspberry device.


Raspberry Pi Samba Server Installation

As you can see, this process is that simple. 

If you have any questions you are curious about, do not hesitate to ask them in the comments below. Have a nice day.