Hey, welcome back to this video.
So in this video, we're going to learn how to set up a samba server.
So in case you do not know what is a samba server, it is basically a protocol which is used to transfer
files between a Linux and a Windows computer.
Now, in this video, we're going to see how to set up your own samba server onto a Linux operating
system through which you can share your files as well as all your directories to any operating system
like Windows or Mac OS.
So let's quickly begin.
Now for that, what we are going to do is we are going to set up the Samba server in two phases.
The first part is going to be a guest samba server in which anyone can connect to your samba server
and fetch your files.
Or also, if you give right permissions, they can modify the files as well.
The second that we are going to see is specific to a user.
So that will be access control, which means only a user X or a user.
Rohit can only access your samba server, see the file, download the file or modify the file.
All right, so let's see the first one, which is creating a guest samba server.
Perfect.
So for this, I'm going to start my parrot operating system.
As you can see, I have already done the SSH into my parrot operating system over here and I'm currently
logged in using route.
This is my virtual machine which is running and you can see this is the parrot OS that I have done ssh
into.
Perfect.
So the first thing that we are going to do is see the IP address and you can see the IP address of my
Linux operating system is 192 160 8.0. 69, which I have seen using the command f config.
Perfect.
Now, once I know the IP address of my Linux machine, I will clear my terminal.
Perfect.
Now for creating a samba server into your computer, you should have the samba service running or the
samba program installed into your computer.
In case you do not know if you have installed this program or this service, you can simply type this
command to check which is service SMB D status.
As you can see, it is active and running into my computer.
Perfect in case it is not installed into your computer and you see an error, you can simply install
it using the command apt hyphen get install samba space hyphen y.
Now it will automatically install all the required packages into your computer.
In my computer it is already installed so I'm not going to install it again.
Perfect.
So the first requirement is successfully fulfilled that we have samba installed into our computers.
The next step is modifying the SNMP configuration file, which is the samba configuration file.
So for that you need to go to this path which is etsi, samba, SMB conf.
And this is the configuration file which is responsible for running settings into the samba server.
Just scroll down at the bottom of this configuration file and you have to write some of the lines as
you can see over here now, as you can see onto the left side of the screen, this is what you have
to write to make a guest samba server.
So basically a command saying Rohit share and the share name.
So this is my Cher.
You can give any name that you want.
So as you can see, I have given my Cher so this name will be shared with the device and they will be
able to see something to that network that has been shared, which is my Cher.
You can give any name you want.
You are free to give that.
The next thing is the command, which is samba works, which will be seen that whenever anyone gets
connected the path, the path is basically the directory that you want to share from your computer.
Read only know.
So we do not want them to only read.
They can write also.
They can also modify and guessed okay.
Is any guest can connect to this samba server perfect.
So you need to add these lines over here.
Now the path over here that I have given is slash route slash UFO net because I want to give the access
of UFO net folder or directory from my samba server.
Perfect.
You can see over here that I have written exactly the same thing and I have saved it and I will come
out of this.
And after you make any changes into the samba configuration file, you need to restart the samba server.
As you can see, I have successfully restarted it and I'm checking if everything is working fine and
you can see it is active and running and there is no issues currently.
That means we are absolutely perfect.
Now I'm showing this into Mac OS.
You can also do this into Windows operating system as well for running this or connecting from a Windows
OS to our Linux operating system which is valid.
You need to open the run prompt from your computer start menu or you can simply press the Windows Command.
You can type double slash the IP address where you want to connect in Mac OS.
You can see you can open any finder and press the shortcut which is command key.
Once you press the command k shortcut as you can see over here, which is connect to server command
k this prompt will open.
Now here you need to type SMB colon, double slash the IP address of the server to which you want to
connect and simply hit connect.
And you can see it shows my share.
This is the name that we have given.
Perfect.
Let's hit.
Okay.
And here you can see this is the folder UFO net, which has been shared from the samba server.
Let's go into the row hit folder and let's see what is inside.
And you can see there is a file called dot txt and we are able to see this.
Let's confirm from our Linux system as well.
Let's go in.
Rohit, let's open a file which is hacked txt and let's verify is there the same content and perfect
here we can see it is exactly the same content over here.
Perfect.
So we are able to successfully access the samba server from our mac os.
Now let's try one more thing as we have given the read only know, which means the user can also write.
So let's try to create a new folder and let's give a name to this folder.
So a random D let's say accesses by Rohit and let's say samba.
And let's see if this folder has been successfully created here or no.
Let's go one step back and do ls and you can see the folder has been successfully created.
So let's go inside this folder and let's create a file and let's see, after we create a file from the
Linux system, we are able to see it in real time over here or no.
So let's create a file using Nano and let's say the file name is done and let's say we write this works
inside it, save it.
And you can see the file has been successfully created over here.
Let's give an extension to this file as well as we need to open it into the Mac OS to verify.
So let's say we move this file to the dot txt and the extension has been successfully changed and you
can see it works.
When I open this file I am able to see the content inside it.
So this is it for this video.
I hope you guys understood how we can configure some server and how we can access it in case we have
any issues or doubt.
You can always post it into the Q&A section.
I will always help you in case you get stuck on any point.
Thank you.