Ubuntu Server Setup
Lección 4 de 5 · Ubuntu Server 14.04 Setup Part 4 – Samba File Server · TI y software
Ubuntu Server 14.04 Setup Part 4 – Samba File Server
all right so we have our Bluetooth server set up with a hostname static IP address what we want to do now is we want to be able to share certain folders
with our Windows Network and by default it can be really tricky but there is something called Samba or Samba that you can install and it'll allow your Linux server to easily communicate with your
Windows machines all right so you'll be able to go to whatever network neighborhood and your Linux server will show up and you'll be able to log in and create files run files whatever all
right so the first thing we want to do is just install samba ok we can do that if we do any actually let's do an app to get update first just to make sure
everything's up to date all right so what we want to do now is just install it so we'll say sudo apt-get install Samba ok yes all right so now summer is installed now
we need to go to the configuration file so when I say sudo nano etc' slash Samba / SMB dots conf okay so this is the main configuration file for Samba and it's
just a lot of different things that you can configure from here and this is also where you're going to add your shares shares being files or folders that are shared with the rest of your network all
right so the first thing we want to do is I'm going to go down here to this workgroup and by default it's workgroup you want to change this to whatever your Windows workgroup is all right so let's
just uh let me show you where to get that now I don't have my computer the my computer icon on my desktop here but what you want to do is right-click on computer or vine computer or whatever it
is and go to properties and it's going to bring up this page and you can see that my computer name is monster and the workgroup I'm on is Brad's Network alright so this is what we want to put
in there obviously you'll put what whatever you want okay so Brad's Network all right and you can just scroll down and you can just look at
some of the different options support for winds networking debugging there's all kinds of authentication rules you can set and then down here is where it says share definitions is where you put
your shares and this is basically what it'll look like the share name will be in brackets the comment will basically be the the human readable name you can set it if you want it to be browsable
and windows or not read only you can set file permissions there's a whole bunch of different settings and you can also share printers you see down here we basically are going to share our
printers alright and you can also specify guests ok for files and printers which means that they'll be able to access without needing an account on the server alright so we're just going to
leave it as is uh just for now into a control X and then Y to save alright and to restart Samba you want to say sudo we start SM VD and also sudo restart NM VD all right now the next thing I want to
do is just add a user to Samba which is fairly easy we're just going to say sudo SMB passwd a and then the name of the user okay and it's going to ask you for a new password
all right let me actually just restart sombre again all right now what I want to do is open up my network in Windows okay so if we go to network and let's go
ahead and reload all right so you can see I've caught a few machines on the network but right here is what we want to look at test server all right so now we're seeing the
linux server and windows okay now the reason there's nothing here is we haven't created any shares yet all right so let's create a share um we're in our home directory now which if you
installed Windows Server and not that I'm sorry Ubuntu server and not the desktop then you don't really have anything in here but let's create a folder inside of our
test server well I create a folder so we'll use the make der command so we'll make a directory and let's just call this shared alright now if we look
we have a folder called shared let's go into that folder with CD alright and we'll create a file here let's create a file using the cat command and it will say my file dot txt permission denied we
need to use sudo still permission denied let's go back to the home directory and I just want to check out the permissions all right so you can see that this shared folder it's owned by by the root
user and it's in the root group we want to change that so I'm going to say CH o N and use the R option and we want to change it to the user Brad and the group Brad okay and then the name of the
folder which is shared and we need to do a sudo as well okay so now if we look at it okay so now it's Brad alright so let's go back into it and try to create that file
all right so there's our file let's go ahead and see if we can edit this this is my file okay we'll save that alright so obviously this isn't going to be shared yet if we go back to Windows
and reload there's nothing there we need to add it to our configuration file our Samba configuration file so we want to do sudo nano etc' slash Samba /sm be calm and then go down and then you go
page down down to I like to put my shares under the actually yeah under this last print actually now I'm going to go up a little bit yeah right here alright so I'll call this
share you can call it whatever you want and comments this is basically what it's going to show what the share is going to be called so I'm just going to leave shared alright next we want to put the
path ok so the path for this is home get home / Brad / shared I'm sorry we need to put path here path equals alright so we're going to say browsable yes read only no guests okay
yes I think that's really all we need alright Abel writeable equals yes all right so let's um exit this now save
it and we want to restart Samba where is it all right so now let's go over to Windows and now you can see we have a folder called share and there's a file
ok so we can easily share all your files on your server with all of your Windows clients and we can edit this file if we want ok I'll just save that and we can edit the file name
all right so we basically have full permission to do what we want with this share and things can go wrong when you're dealing with Samba that actually went really smooth but sometimes you
have issues with permissions basically you just want it you want to add your Samba user and make sure that that the files that the folders you create belong to that user and are in that users group
and you should be okay and since we put guests ok equals yes we don't need a password to go into this fold into the share right so that's how you can create a Samba server on your a bun to machine
Share your Ubuntu Server folders and files with your Windows clients using Samba