 Hey everybody, welcome back to the channel. Today I'm going to show you a fairly simple way of getting Samba sharing working on your Linux desktop. Now for those of you who don't know Samba is basically a service that allows you to share files between Linux computers. Now there's also a way you can access a Samba share from Windows. I've only been successful at a couple times. It's kind of a pain in the ass. It's just the way it is because Windows sucks. I'm just putting that out there. But if you're doing this from Linux, it's very easy. So first you have to obviously install Samba. So in order to do that, let's jump over into a terminal here. And if you're on Arch Linux, you want to do sudo pacman dash capital S, Samba. If you're on Arch, or if you're on Ubuntu, you just do sudo apt. Oops, it's I cannot spell apt install Samba. That's all you'd have to do. Okay, I've already done this. So I don't need to do it again. The next thing you're going to want to do is create a directory that you want to share or know the path of the directory you want to share. So if you want to show your documents folder, that one's going to be home slash your username slash documents. If you create a new one, which I did, I created a folder here called Sharebox. It's one right, it's right here. And right now it's empty. There's nothing in there, but this is the one I'm going to share. So in order to get this thing to be shareable, you have to go through and edit a configuration file. That configuration file is located in Etsy folder. So let's just CD into a CD slash Etsy slash Samba. Now, mine is going to look a little bit different than yours because I have some different things in here and I've already done some work here. So you won't have this one here and you won't have this one here likely, but you should have this one here. Now, there are some things you want to do. So the first thing you want to do is to see pseudo CP this one here into SMB.com. Now, I'm going to use the Arco Linux one, simply because I know it works for sure. The difference here is if we if we vim it into this other one, then smb.conf.default. Okay. The difference here is that you'll have to make sure your work group here is work group. Okay, you don't want this to be my group. You want to be work group, especially if you're going to be changing or sharing this with a Windows computer. Everything else should be exactly the same. I'm having some of them errors that are just ignore those because whatever. So what you'll want to do is copy this folder into a folder that's called smb.conf because Samba itself will not actually use this folder here, or this configuration file without it being wonky. So just make sure you copy it. So I've since I've already done this, I'm going to them into that. So I'm make sure you use pseudo. And I'm going to use them. So I don't get those errors. And we'll just do this. Okay. I'll zoom in so you can actually see. So as you can see, this one here has been changed to work group that way it actually will work with Windows if I needed to do so. I don't actually have any Windows computers that I want to do that but whatever. So at the end at the very bottom of the file, you want to put this here. Now, depending on who you ask, the word browsable spelled with E or without any. I'm pretty sure it works both ways. I'm not sure why it does. The Arch Linux guys will have it with the E. I believe that the standard one will. So the standard one won't use as an E as well. So but if you look on like the Ubuntu tutorial for how to do this, it doesn't use an E. So we're going to use an E. Somebody somewhere along line doesn't know how to spell how you actually spell. I think it is spelled the knee. So we'll just do pseudo. We'll get back into the regular one here. I really got to turn persistence back on for due as but whatever. So I'm going to make sure this has an E in it. Okay. Anyways, you want to go through and put a comment which can just be the name of the folder or it can be anything really. The path to the folder that you're sharing, make sure redotently is set to no and that browsable is set to yes. Now there are other things that you can do. You can make it completely public which means that will not use your Samba username and password in same thing with the guest full thing here. I'm just going to leave it at this here. So once you've put this in there, you can save the save this and quit. Okay. And then CD back into your home directory. So the next thing you'll want to do is start the service. Now, how you do this depends on what distribution you're using. Now, if you're on a Buntu, you're going to want to do pseudo service SMB D restart. I don't know if the archway will actually work on a boot. I'm not sure. But for me, my purposes here, I'm going to do pseudo SMB D start. Okay. And then you're going to need a password obviously. And you should have no output that obvious that just means Samba is now running in the background. And it's using your new configuration file to do it. Okay. So the next thing you don't want to do, because right now, technically, if you went to another computer and got into their file browser, specifically for analytics, and you went to the network, and you'd find the name of your computer here. And you'd see the folder that you just shared. But you would not be able to access it because you do not have permission to do so. So what you need to do is create a Samba user. In order to do that, you need to do this here, pseudo SMB PAS SWD, and then give it a flag, and then your username. Okay, it can be the username you're going to be using on your computer, it can be used that use this a random username, it doesn't matter, just as long as you know what it is. Okay, and then it's going to ask you for password. So give it a password. And then it's going to as you confirm that password, excuse me, I'm sorry, I messed that up. pseudo is going to ask you for password, and then it's going to ask you for a new password for the this user. So once it's done that you should get a confirmation that it's added to the user you just have the username you just created. And then it's just a matter of going to the other computer, and signing in. So let me see if I can show you this, it's not going to look the same. But you want to get in almost every Linux file manager, you'll see a network thing here. And then you'll see the name of your computer. And then here's where will they be different than what you're you're seeing here, because I'm actually on this computer. So it's not going to ask me for username and password. But on another computer, you'll be able to ask you for your username that you just set up. And the password you just set up. So you'd have to sign in. And a lot of times they'll ask you whether or not you want to remember your password or not. Do whatever you feel is most secure. And then you'll see the pet the folder that you just shared. Actually, here we go. You want to register user username, make sure the work group is the same as the work group we just set it as work group, and then enter your password. I'm not going to do that because I'm already on this computer. But it should share just perfectly fine. Now, if we go back over to the terminal here and go back into our at C, and go back into our SM, our SAMBA configuration file. So we'll do sudo, and then into SMB.com patent mistype the password. Man, is it really annoying having to type that password every time I have to remember to reset up persistence. Anyways, if we go back to the bottom here, let's just say we want to do a folder that's already existing on our computer, we didn't create one we want to like the documents folder, or something like that. It's exactly the same. So if we just do, let's just copy this here. Bank. And then we'll go into insert mode. Actually, we'll go back to the bottom. And then we'll just paste it. What we want to do here is change this word to change word documents. Okay, and then we can just do change word documents. And then down here, change word documents. And then all we have to do is do right and quit this. And then what you're going to want to do is restart SAMBA. So again, this may be different on Ubuntu. So if we just see back into our our home directory. And for at least for arts, we just do pseudo SMBD restart. Okay, that just restart Sambo with the changes to the configuration file we just made. Very simple. You can also just do start it functions the same way. Now, like I said, on Ubuntu, this might be a little bit different. So you might need to do pseudo service SMBD restart. That's what the Ubuntu wiki says, or their tutorial guide or whatever it says. So just be aware that it might be different on Ubuntu. For sure on on Linux or on arch and arch based distributions like this one here, it's just pseudo start SMBD, or pseudo SMBD restart. I mean, okay, very easy. The one thing that I don't have available to show you is how to do this through a firewall. So if you use ufw, which I believe is uncomplicated firewalls with that stands for, there's going to be a way that you have to set this up. I will leave a link to the Ubuntu setup. You just have to do pseudo pseudo ufw allow SAMBA that should allow it to go through, you know, and get through your firewall without having you to open up another port. So that's it. That's how you use SAMBA. Very simple. The hardest part is going to be remembering to change that work group from the default folder. Because like I said, that's the reason why I use use the the the Oracle Linux one. It's all the same except for there's a few more examples in the default one. And there is that work group thing you just have to change. So if you like this video, give it a thumbs up. If you didn't give it a thumbs down, you can support the channel by subscribing to the channel or going to our Patreon page at patreon.com slash Linux cast. Very soon, we're going to be having it setup so that all patrons level two or level three will access to our videos a day early. They'll also have access to the ability to vote on topics and things for the channel and podcast. And there might be some merch, there might be some merch eventually, probably towards the middle of the year. So make sure you go over there and help us out. Thanks to Devansi for being our first patron. And I'll see you next time. Thanks for watching.