Configuring a Samba Linux Server

© 2001 Chris Tillison
Home    3Com Switch    ATM_Switch    VeNeLa_Network    Multi-Homed_PC    Ethernet_on_Linux_7.1    ATM_Card_2000    ATM_Card_98    Package Installation    Samba Windows Server    Samba Linux Server    Apache Web Server    NFS Configuration    Name Services


Before playing with Samba, you need to make sure the following packages are installed on Linux : samba-common-2.0.7-36.i385.rpm, samba-client-2.0.7-36.i386.rpm, samba-2.0.7-36.i386.rpm, and xinetd 2.1.8.9pre14-6.i386.rpm. You can make sure by going to GnoRPM in the program menu. The samba common and samba client packages are located under /Applications/System. The samba and xinetd packages are located under /System Environment/Daemons. If they're not installed, read the documentation on how to install packages.

One of the first things you'll want to do when you have everything installed is to configure samba so that it starts up every time you startup your computer. You can do this by going to the contral panel in the program menu. Then in the new window you need to click on the button for the runlevel editor. It's the one that looks like two flashing red lights.


This will bring up the RunLevel Editor window. Scrolling down the list of available applications to the left, you should find one that says smb. You want to make sure that this application appears in the columns 3 and 5 for both the start and stop rows. If they don't, you will have to add the application to those areas. Clicking "ADD" will begin this process.
You can use the add window to apply the application to any row or column. You will probably need to add it to the start row under level 3. Then click on done and a new window will pop up telling you where the application will be added and what number will be assigned to it. This part is unimportant. Just leave it as 91. Click done and you're finished. Repeat this process for level 5.


Now you can go ahead and start samba using the "execute" button or type in samba start at the command line in a terminal window.

The main file for configuring samba is the smb.conf file located in /etc/samba. The file itself is substantially big and there are too many options available to go into detail so we only cover the basic principles here. If you would like to look at a sample of the file, you can go here.

There are four main areas that we wish to pay attention to:
[global]
   workgroup = WORKGROUP
   encrypt passwords = yes
   smb passwd file = /etc/samba/smbpasswd
   include = /etc/samba/smb.conf.%m
Everything in the global section has to do with how samba connects to the network. The workgroup name should be the same as the one you've specified for the network. Newer versions of Windows are set up so to use encrypted passwords but Samba does not so you will have to uncomment the lines that read encrypt passwords and smb passwd file. You will also have to uncomment the line "include". This allows you to set up your Linux machine using the smb.conf file located in the /etc directory. You can have copies of the smb.conf placed within other directories in this case and still use the one in the /etc/samba directory.
[homes]
   comment = Home Directories
   browseable = no
   read only = yes
   writeable = yes
   printable = no
The homes field has to do with the properties of user accounts established on your Linux machine and how those accounts are accessed across the network. You can make other folders in the account browseable. You can set up the access as read only, write, or print. There are other options available but the choice is up to you.
[public]
   comment = Public Stuff
   path = /home/earth
   public = yes
   writeable = yes
   printable = no
This field is just an example of how you can share folders with the network. It's set up in the same fashion as the homes section with one noticeable difference. The path of the folder must be explicitly defined or else you get a bad connection. Make sure the directory exists before typing in the path.
[printers]
   comment = All Printers
   security = server
   path = /var/spool/lpd/lp
   browseable = no
   printable = yes
   public = yes
   writeable = no
[hpljet]
   security = server
   path = /var/spool/lpd/lp
   printer name = lp
   printable = yes
   public = yes
   writeable = yes
   print command = lpr -r -h -P %p %s
The printers field is set up by default to access the local printer defined in /var/spool/lpd/lp. The bracketed share [hpljet] is just an example of how you can share a linux printer with the network. Make certain that the printer path under your shared printer (in this case [hpljet]) matches the spool directory in /etc/printcap. The name of this file is also included in the global section and selected by default.

That is all there is to the smb.conf file. If you want more details about setting up a Linux or Windows Server check out the rest of the website.
Home    3Com Switch    ATM_Switch    VeNeLa_Network    Multi-Homed_PC    Ethernet_on_Linux_7.1    ATM_Card_2000    ATM_Card_98    Package Installation    Samba Windows Server    Samba Linux Server    Apache Web Server    Name Services