Hey, welcome back to this video.
So in this video we are going to learn how to
set up a Samba server. So in case you do
not know what is 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 are 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 a excess 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. Alright, 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 root. 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 168
dot 0.69, which
I have seen using the command if 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 smbd 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 a error you can simply install it
using the command apt-get install Samba
space - 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
SMB configuration file, which is the samba configuration
file. So for that you need to go to
this path, which is ETC Samba smb.com. 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 comment
saying rohit's share and the
share name. So this is my share you can give any
name that you want. So as you can see I have given my share
so this name will be shared with the device and
they will be able to see something into that Network that
has been shared which is my share.
You can give any name you want you're free to give that the next
thing is the comment.
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
no, so we do not want them
to only read they can write also they
can also modify and guest. 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
root slash UFO net because I want
to give the excess 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
parrot. You need to open the Run prompt from
your computer start menu, or you
can simply press the windows R 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 k
Once you press the command key shortcut, as
you can see over here, which says 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 OK
and here you can see this is the
folder UFO net which has been shared
from the Samba server. Let's go into the Rohit
folder and let's see what is inside and you
can see there is a file called as hack 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 hack Dot 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 no 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 randomly let's say xss 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 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 done 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 Samba server and how
we can access it in case you 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.