1 00:00:00,430 --> 00:00:02,350 Hey, welcome back to this video. 2 00:00:02,770 --> 00:00:07,750 So in this video, we're going to learn how to set up a samba server. 3 00:00:07,750 --> 00:00:15,310 So in case you do not know what is a samba server, it is basically a protocol which is used to transfer 4 00:00:15,310 --> 00:00:19,150 files between a Linux and a Windows computer. 5 00:00:19,180 --> 00:00:26,470 Now, in this video, we're going to see how to set up your own samba server onto a Linux operating 6 00:00:26,470 --> 00:00:33,640 system through which you can share your files as well as all your directories to any operating system 7 00:00:33,640 --> 00:00:35,890 like Windows or Mac OS. 8 00:00:36,550 --> 00:00:37,930 So let's quickly begin. 9 00:00:38,410 --> 00:00:45,710 Now for that, what we are going to do is we are going to set up the Samba server in two phases. 10 00:00:45,730 --> 00:00:52,570 The first part is going to be a guest samba server in which anyone can connect to your samba server 11 00:00:52,570 --> 00:00:54,220 and fetch your files. 12 00:00:54,220 --> 00:00:58,840 Or also, if you give right permissions, they can modify the files as well. 13 00:00:59,110 --> 00:01:03,400 The second that we are going to see is specific to a user. 14 00:01:03,970 --> 00:01:10,120 So that will be access control, which means only a user X or a user. 15 00:01:10,120 --> 00:01:17,860 Rohit can only access your samba server, see the file, download the file or modify the file. 16 00:01:17,890 --> 00:01:23,140 All right, so let's see the first one, which is creating a guest samba server. 17 00:01:23,830 --> 00:01:24,590 Perfect. 18 00:01:24,610 --> 00:01:28,540 So for this, I'm going to start my parrot operating system. 19 00:01:28,540 --> 00:01:35,650 As you can see, I have already done the SSH into my parrot operating system over here and I'm currently 20 00:01:35,650 --> 00:01:37,180 logged in using route. 21 00:01:37,300 --> 00:01:43,930 This is my virtual machine which is running and you can see this is the parrot OS that I have done ssh 22 00:01:43,930 --> 00:01:44,530 into. 23 00:01:44,830 --> 00:01:45,400 Perfect. 24 00:01:45,400 --> 00:01:51,460 So the first thing that we are going to do is see the IP address and you can see the IP address of my 25 00:01:51,460 --> 00:01:59,800 Linux operating system is 192 160 8.0. 69, which I have seen using the command f config. 26 00:02:00,220 --> 00:02:01,060 Perfect. 27 00:02:01,090 --> 00:02:06,490 Now, once I know the IP address of my Linux machine, I will clear my terminal. 28 00:02:06,850 --> 00:02:07,540 Perfect. 29 00:02:07,720 --> 00:02:15,910 Now for creating a samba server into your computer, you should have the samba service running or the 30 00:02:15,910 --> 00:02:18,640 samba program installed into your computer. 31 00:02:19,360 --> 00:02:25,120 In case you do not know if you have installed this program or this service, you can simply type this 32 00:02:25,120 --> 00:02:29,660 command to check which is service SMB D status. 33 00:02:29,680 --> 00:02:33,120 As you can see, it is active and running into my computer. 34 00:02:33,130 --> 00:02:39,730 Perfect in case it is not installed into your computer and you see an error, you can simply install 35 00:02:39,730 --> 00:02:45,250 it using the command apt hyphen get install samba space hyphen y. 36 00:02:45,490 --> 00:02:50,980 Now it will automatically install all the required packages into your computer. 37 00:02:51,730 --> 00:02:56,660 In my computer it is already installed so I'm not going to install it again. 38 00:02:56,680 --> 00:02:57,400 Perfect. 39 00:02:57,490 --> 00:03:04,210 So the first requirement is successfully fulfilled that we have samba installed into our computers. 40 00:03:05,430 --> 00:03:11,940 The next step is modifying the SNMP configuration file, which is the samba configuration file. 41 00:03:11,940 --> 00:03:17,450 So for that you need to go to this path which is etsi, samba, SMB conf. 42 00:03:17,670 --> 00:03:24,300 And this is the configuration file which is responsible for running settings into the samba server. 43 00:03:24,750 --> 00:03:32,010 Just scroll down at the bottom of this configuration file and you have to write some of the lines as 44 00:03:32,010 --> 00:03:38,370 you can see over here now, as you can see onto the left side of the screen, this is what you have 45 00:03:38,370 --> 00:03:40,950 to write to make a guest samba server. 46 00:03:41,130 --> 00:03:46,320 So basically a command saying Rohit share and the share name. 47 00:03:46,320 --> 00:03:47,670 So this is my Cher. 48 00:03:47,850 --> 00:03:49,800 You can give any name that you want. 49 00:03:49,800 --> 00:03:55,470 So as you can see, I have given my Cher so this name will be shared with the device and they will be 50 00:03:55,470 --> 00:04:00,090 able to see something to that network that has been shared, which is my Cher. 51 00:04:00,480 --> 00:04:01,890 You can give any name you want. 52 00:04:01,890 --> 00:04:03,330 You are free to give that. 53 00:04:03,330 --> 00:04:09,720 The next thing is the command, which is samba works, which will be seen that whenever anyone gets 54 00:04:09,720 --> 00:04:16,500 connected the path, the path is basically the directory that you want to share from your computer. 55 00:04:16,890 --> 00:04:18,060 Read only know. 56 00:04:18,060 --> 00:04:21,030 So we do not want them to only read. 57 00:04:21,030 --> 00:04:22,770 They can write also. 58 00:04:22,920 --> 00:04:25,830 They can also modify and guessed okay. 59 00:04:25,860 --> 00:04:30,930 Is any guest can connect to this samba server perfect. 60 00:04:31,020 --> 00:04:33,240 So you need to add these lines over here. 61 00:04:33,780 --> 00:04:41,040 Now the path over here that I have given is slash route slash UFO net because I want to give the access 62 00:04:41,040 --> 00:04:45,540 of UFO net folder or directory from my samba server. 63 00:04:45,900 --> 00:04:46,680 Perfect. 64 00:04:46,950 --> 00:04:52,500 You can see over here that I have written exactly the same thing and I have saved it and I will come 65 00:04:52,500 --> 00:04:53,100 out of this. 66 00:04:53,100 --> 00:05:00,570 And after you make any changes into the samba configuration file, you need to restart the samba server. 67 00:05:01,020 --> 00:05:06,720 As you can see, I have successfully restarted it and I'm checking if everything is working fine and 68 00:05:06,720 --> 00:05:11,340 you can see it is active and running and there is no issues currently. 69 00:05:11,340 --> 00:05:13,590 That means we are absolutely perfect. 70 00:05:14,640 --> 00:05:17,460 Now I'm showing this into Mac OS. 71 00:05:17,460 --> 00:05:23,850 You can also do this into Windows operating system as well for running this or connecting from a Windows 72 00:05:23,850 --> 00:05:27,270 OS to our Linux operating system which is valid. 73 00:05:27,360 --> 00:05:34,980 You need to open the run prompt from your computer start menu or you can simply press the Windows Command. 74 00:05:35,220 --> 00:05:40,560 You can type double slash the IP address where you want to connect in Mac OS. 75 00:05:40,560 --> 00:05:45,900 You can see you can open any finder and press the shortcut which is command key. 76 00:05:46,440 --> 00:05:52,650 Once you press the command k shortcut as you can see over here, which is connect to server command 77 00:05:52,650 --> 00:05:54,810 k this prompt will open. 78 00:05:54,810 --> 00:06:01,200 Now here you need to type SMB colon, double slash the IP address of the server to which you want to 79 00:06:01,200 --> 00:06:03,120 connect and simply hit connect. 80 00:06:04,220 --> 00:06:06,740 And you can see it shows my share. 81 00:06:06,770 --> 00:06:08,580 This is the name that we have given. 82 00:06:08,600 --> 00:06:09,090 Perfect. 83 00:06:09,110 --> 00:06:09,620 Let's hit. 84 00:06:09,620 --> 00:06:10,160 Okay. 85 00:06:10,250 --> 00:06:17,600 And here you can see this is the folder UFO net, which has been shared from the samba server. 86 00:06:17,750 --> 00:06:21,380 Let's go into the row hit folder and let's see what is inside. 87 00:06:21,380 --> 00:06:26,150 And you can see there is a file called dot txt and we are able to see this. 88 00:06:26,270 --> 00:06:29,630 Let's confirm from our Linux system as well. 89 00:06:29,660 --> 00:06:30,320 Let's go in. 90 00:06:30,320 --> 00:06:37,130 Rohit, let's open a file which is hacked txt and let's verify is there the same content and perfect 91 00:06:37,130 --> 00:06:40,580 here we can see it is exactly the same content over here. 92 00:06:41,810 --> 00:06:42,440 Perfect. 93 00:06:42,440 --> 00:06:47,630 So we are able to successfully access the samba server from our mac os. 94 00:06:47,900 --> 00:06:55,580 Now let's try one more thing as we have given the read only know, which means the user can also write. 95 00:06:55,580 --> 00:07:00,020 So let's try to create a new folder and let's give a name to this folder. 96 00:07:00,020 --> 00:07:05,030 So a random D let's say accesses by Rohit and let's say samba. 97 00:07:05,390 --> 00:07:10,190 And let's see if this folder has been successfully created here or no. 98 00:07:11,030 --> 00:07:16,430 Let's go one step back and do ls and you can see the folder has been successfully created. 99 00:07:16,490 --> 00:07:22,970 So let's go inside this folder and let's create a file and let's see, after we create a file from the 100 00:07:22,970 --> 00:07:26,840 Linux system, we are able to see it in real time over here or no. 101 00:07:26,990 --> 00:07:35,060 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 102 00:07:35,060 --> 00:07:36,500 inside it, save it. 103 00:07:37,130 --> 00:07:40,580 And you can see the file has been successfully created over here. 104 00:07:41,470 --> 00:07:46,330 Let's give an extension to this file as well as we need to open it into the Mac OS to verify. 105 00:07:46,360 --> 00:07:54,100 So let's say we move this file to the dot txt and the extension has been successfully changed and you 106 00:07:54,100 --> 00:07:55,290 can see it works. 107 00:07:55,300 --> 00:07:58,990 When I open this file I am able to see the content inside it. 108 00:07:59,260 --> 00:08:00,970 So this is it for this video. 109 00:08:01,000 --> 00:08:07,150 I hope you guys understood how we can configure some server and how we can access it in case we have 110 00:08:07,150 --> 00:08:08,710 any issues or doubt. 111 00:08:08,710 --> 00:08:11,170 You can always post it into the Q&A section. 112 00:08:11,170 --> 00:08:15,640 I will always help you in case you get stuck on any point. 113 00:08:15,670 --> 00:08:16,420 Thank you.