Hey, welcome back to this video.
So in this lesson, we are going to learn how
you can configure Samba with a specific
user in the previous lesson. We have
learned how you can configure Samba for guest user
which basically means anyone into
that Network can access your sambar share
and all your private files. But now
we want to keep excess control and we
only want to provide access to those users
which have the username and
password for our Samba server. So
this basically means we are providing authentication and
there will be a username and password
which we are going to send.
Which we are going to set for accessing our
Samba share. Alright, so for
this we are going to add a username and
a password. So let's quickly see that so I have
already logged in into my parrot OS on which
I'm going to configure the Samba server.
So first thing first, we are going to add a user which
is shifa. I have already added a user in
my computer. That is the reason it is saying that user
already exists in your computer.
You may not see the error because you do not have this user
or in case you have the user and you
see this error. No problem. You can move further.
You can simply set a password for that
user as well. So for Simplicity, I'm going to set the password
as root for now. Now I
have created a user and I also set a password for
that user. Now. I need to add this user
to the SMB login list or
the SMB user list for that. I'm going to use the command
which is SMB past WD - A that
means I want to add a user which is shifa
and hit enter and it is going to ask you
to create a password. So let me again keep this
same password as root.
Now I have successfully create.
Now I have successfully created a SMB user
as well. Perfect. Remember in case
you want to remove a user you can use hyphen X
to remove in case you want to add a user
you can use hyphen a perfect. Let's move
again.
Let us modify the configuration file
for Samba and here
once we log in you can see here. I have
already written something. So this is she fast
share that I have given the name comment is
Samba works. I have created a directory valid
uses shifa and read only
no perfect. So I have specified a user
over here, which is shifa. You can specify more users
if you want by giving just a space over here.
So let's say she far Rohit or x y
z any user now, I'm going to save this
configuration file and you need to restart the
smbd service in case you
make any changes now, I have successfully restarted it
and let me just verify if everything is working
fine.
And you can see over here it is active and
running which means it is working perfectly fine.
So it's time to login and check if the
user that we have created is working fine or
no. So, let me open a finder and let me
open up this connect to server dialog box
using the shortcut which is command k
Let me connect to the IP address and hit on connect
and let's wait for this. It should ask us
for a prompt and it is asking us for a
prompt. So the name of the user which is the registered
user. This time is shifa and the password is
root and let's hit on connect.
Let's wait for this to verify and
you can see shifas share. Let me
just hit enter and perfect. You can see there is
a file called as secret. Let me open it and you
can see this is a secret file perfect. Now,
let's verify this the same file. Let's
go to the folder, which is shifa.
And you can see there is a file called as secret Dot
txt.
Perfect. Now we are able to complete this practical in
which we saw in case there are
some confidential or private files in this
computer, and we want to share those file on
our Samba. So for that we can also
authenticate the user by making
a Samba user. So in this case we created
a user that was shifa, and yes, no
guest user can connect to this registered
user and cannot access your sensitive
files. So this way you can protect your sensitive content
by creating a user and you can configure a
password for that as well. So I hope you guys understood. Thank
you.