1 00:00:01,070 --> 00:00:03,050 Hey, welcome back to this video. 2 00:00:03,230 --> 00:00:09,770 So in this lesson, we're going to learn how you can configure samba with a specific user. 3 00:00:09,800 --> 00:00:16,520 In the previous lesson, we have learned how you can configure samba for guest user, which basically 4 00:00:16,520 --> 00:00:23,210 means anyone into that network can access your samba share and all your private files. 5 00:00:23,210 --> 00:00:31,970 But now we want to keep access control and we only want to provide access to those users which have 6 00:00:31,970 --> 00:00:35,600 the username and password for our samba server. 7 00:00:35,600 --> 00:00:42,530 So this basically means we are providing authentication and there will be a username and password which 8 00:00:42,530 --> 00:00:43,760 we are going to send. 9 00:00:45,090 --> 00:00:49,620 Which we are going to set for accessing our samba share. 10 00:00:49,650 --> 00:00:50,280 All right. 11 00:00:50,280 --> 00:00:55,770 So for this, we are going to add a username and a password, so let's quickly see that. 12 00:00:55,770 --> 00:01:01,620 So I have already logged in into my pirate OS on which I'm going to configure the samba server. 13 00:01:02,040 --> 00:01:05,550 So first thing first, we are going to add a user which is Shifa. 14 00:01:05,760 --> 00:01:08,520 I have already added a user in my computer. 15 00:01:08,520 --> 00:01:13,770 That is the reason it is saying that user already exists in your computer. 16 00:01:13,770 --> 00:01:20,280 You may not see the error because you do not have this user or in case you have the user and you see 17 00:01:20,280 --> 00:01:22,740 this error, no problem, you can move further. 18 00:01:23,280 --> 00:01:26,430 You can simply set a password for that user as well. 19 00:01:26,430 --> 00:01:30,870 So for simplicity, I'm going to set the password as root for now. 20 00:01:31,140 --> 00:01:35,370 Now I have created a user and I also set a password for that user. 21 00:01:35,400 --> 00:01:42,180 Now I need to add this user to the SMB login list or the SMB user list. 22 00:01:42,180 --> 00:01:46,860 For that, I'm going to use the command, which is SMB pass WD hyphen A. 23 00:01:46,860 --> 00:01:53,490 That means I want to add a user which is shiffer and hit enter and it is going to ask you to create 24 00:01:53,490 --> 00:01:54,240 a password. 25 00:01:54,240 --> 00:01:57,690 So let me again keep the same password as root. 26 00:01:58,350 --> 00:02:05,700 Now I have successfully create now I have successfully created an SMB user as well. 27 00:02:05,730 --> 00:02:06,360 Perfect. 28 00:02:06,810 --> 00:02:12,120 Remember, in case you want to remove a user, you can use hyphen x to remove. 29 00:02:12,120 --> 00:02:16,200 In case you want to add a user, you can use hyphen a perfect. 30 00:02:16,200 --> 00:02:17,190 Let's move again. 31 00:02:18,210 --> 00:02:22,980 Let us modify the configuration file for sampa. 32 00:02:23,340 --> 00:02:28,740 And here once we log in, you can see here I have already written something. 33 00:02:28,740 --> 00:02:35,910 So this is Schieffer's share that I have given the name comment is Samba works I have created a directory 34 00:02:35,910 --> 00:02:39,960 valid users SCHIEFFER and read only know perfect. 35 00:02:39,960 --> 00:02:42,630 So I have specified a user over here which is. 36 00:02:42,630 --> 00:02:47,940 SCHIEFFER You can specify more users if you want by giving just a space over here. 37 00:02:47,940 --> 00:02:48,540 So let's say. 38 00:02:48,540 --> 00:02:52,230 SCHIEFFER, Rohit or X, Y, Z, any user. 39 00:02:52,380 --> 00:02:59,910 Now I'm going to save this configuration file and you need to restart the SMB service in case you make 40 00:02:59,910 --> 00:03:00,900 any changes. 41 00:03:01,080 --> 00:03:06,960 Now, I have successfully restarted it and let me just verify if everything is working fine. 42 00:03:08,310 --> 00:03:14,130 And you can see over here it is active and running, which means it is working perfectly fine. 43 00:03:14,130 --> 00:03:20,220 So it's time to log in and check if the user that we have created is working fine or no. 44 00:03:20,310 --> 00:03:27,240 So let me open up finder and let me open up this connect to server dialog box using the shortcut which 45 00:03:27,240 --> 00:03:28,350 is command k. 46 00:03:29,630 --> 00:03:34,340 Let me connect to the IP address and hit on Connect and let's wait for this. 47 00:03:34,370 --> 00:03:39,000 It should ask us for a prompt and it is asking us for a prompt. 48 00:03:39,020 --> 00:03:45,680 So the name of the user, which is the registered user this time is Shiffer and the password is root 49 00:03:45,680 --> 00:03:47,240 and let's hit on connect. 50 00:03:48,270 --> 00:03:50,900 Let's wait for this to verify. 51 00:03:50,910 --> 00:03:52,980 And you can see she first share. 52 00:03:53,220 --> 00:03:55,820 Let me just hit enter and perfect. 53 00:03:55,830 --> 00:03:58,290 You can see there is a file called A Secret. 54 00:03:58,320 --> 00:03:59,340 Let me open it. 55 00:03:59,340 --> 00:04:02,220 And you can see this is a secret file. 56 00:04:02,490 --> 00:04:03,210 Perfect. 57 00:04:03,240 --> 00:04:04,830 Now, let us verify this. 58 00:04:04,830 --> 00:04:05,770 The same file. 59 00:04:05,790 --> 00:04:07,830 Let's go to the folder, which is Shifa. 60 00:04:08,880 --> 00:04:12,420 And you can see there is a file called a secret text. 61 00:04:12,930 --> 00:04:13,490 Perfect. 62 00:04:13,500 --> 00:04:20,490 Now we are able to complete this practical in which we saw in case there are some confidential or private 63 00:04:20,490 --> 00:04:26,070 files in this computer and we want to share those file on our samba. 64 00:04:26,190 --> 00:04:32,430 So for that, we can also authenticate the user by making a samba user. 65 00:04:32,430 --> 00:04:35,910 So in this case we created a user that was Shifa. 66 00:04:35,910 --> 00:04:43,510 And yes, no guest user can connect to this registered user and cannot access your sensitive files. 67 00:04:43,530 --> 00:04:49,320 So this way you can protect your sensitive content by creating a user and you can configure a password 68 00:04:49,320 --> 00:04:50,340 for that as well. 69 00:04:50,400 --> 00:04:51,960 So I hope you guys understood. 70 00:04:51,990 --> 00:04:52,680 Thank you.