SDB:Samba file sharing in openSUSE - breaking through the window

From openSUSE


Version: 10.2

Situation

In the networks sometimes for different reasons is usefull to have different machines that we may want to connect. Samba(smb, server message block) provides all the neccesary to connect windows and linux computers so we can use all the advantages that this all systems provides within our network. This article will define the simplest samba configuration that will suit in our home networks.

Background

In order to make this work, first of all we have to provide ourselves with the packages which contain this service. These are the main ones, but we would find more samba related packages in the openSUSE distribution:

samba		Basically the file and printing server.
samba-client	All the neccesary to use our linux machine as a windows client.
samba-doc	Documentation with samples of the configuration files.

Other packages that I would like you to install are the following:

kdebase3-samba
yast2-samba-client
yast2-samba-server	Using Yast, we can configure to run our samba server and client.

The list of tasks will be this:


1) Install missing packages.
2) Enable Samba service in the firewall.
3) Edit the smb.conf configuration file.
4) Enable the users in linux.
5) Turn on the services.

On duty

Well,to enable the interconnection between the machines and to keep the security standards, the first thing we should do at the beginning is to enable the samba port for traffic in our firewall. We will do this first task using Yast.

Yast2 -> Security and Users ->  Firewall 

In the left hand frame of the window we have to click in allowed services and once there scrolling down in the list-button we select "Samba server". Then we click on add and after saving all the changes we finish yast.

Now its time to go to set up the samba configuration file which is called smb.conf and is located in:

 /etc/samba/smb.conf

This file have a lot of parameters but this article is intended to enable the basic service for file sharing. The parameters that are not in this list, you can mark then with an #(means the line will not be executed and will be treated just as a comment) in the beginning of the line. There are also some lines regarding printing but that would be for the next article ;) To modify the file will be ok using our favourite text editor:

[global]
	workgroup = home		All network sharing system needs a workgroup. Ensure all the machines 
                                        (windows,linux)have the same.
	netbios name = Samba		Is the name of our linux machine that we will see from windows when we 
                                        click in workgroup view.
	encrypt passwords = yes		Win 2k, xp use encripted passwords.
	security = sambatest		Is the name of the windows machine that is allowed to use the samba  
                                        shares. You can add more.
	usershare max shares = 100	Maximum users.

[homes]					With this we can share the home folders of the users in linux.
	comment = Home Directories	
	browseable = no			We set this option to "no", we dont want anybody lookin at our systems.
	read only = no			We set it to know so we allow to write and modify this folder.
	
[share]					Another shared folder.
	path = /data/share		You can create in your sistem a folder and use it specifically to share
                                        files.
	browseable = yes		Will be important to check the permisions, so our users could actually use
                                        the files.
	write list = mw, user		Users allowed to write. Add any windows users name you have in your 
                                        network.

After this, we have to create the users in our system. There are many ways to do this but I will go rather for the Yast way ;)

Yast2 -> Security and Users ->  User management

Then we click on add and we set the parameters for them. This users need the same name as the windows users.

And now to finish we have to switch on the samba services. Opening a konsole screen we do the following:

su root -> enter root password
/etc/init.d/smb restart
/etc/init.d/nmb  restart

Warning: Any time we change the configuration file, to use the new changes will requiere to re-run the two samba services.

Its time to check the whole thing works. Lets go to one of our windows machines and explore the workgroup.