Next Previous Contents

3. Samba Server Setup

If you install the samba package under Red Hat Linux, most of the server setup is already done for you. The two important daemons (smbd, the Samba server, and nmbd, the netbios name server) are started at boot time by default (see the file /etc/rc.d/init.d/smb).

You will most likely need to modify the Samba configuration file /etc/smb.conf. Use man smb.conf to find out more details about this file. The file is divided into sections (indicated by square brackets; e.g. [global], [homes], and [printers]) and options within each section. Comments are indicated by a leading semicolon (;) in the smb.conf file. The default file has a variety of sections which can be used as a basis for developing your own setup.

Examples of the main sections and significant options with annotations are listed below:


[global]
    workgroup = workgroupname
    ; e.g. LANGROUP (default for nmbd) or MYNET (see example in
    ;    the ``Basic WfWg Setup'' section below) -- your choice, but 
    ;    needs to be consistent across the systems
    printing = bsd
    printcap name = /etc/printcap 
    ; make sure the above path for the printcap file is correct
    load printers = yes
    guest account = guestaccountname    
    ; make sure this user is created; e.g. I created an account called pcguest
    lock directory = /usr/local/samba/var/locks    
    ; make sure the path you choose exists
    share modes = yes
    status = yes       
    ; this is necessary for the smbstatus utility to work
    ; debuglevel = 3     
    ; see the ``Samba Utilities'' section below -- the debuglevel option
    ;    is good for finding information about problems should they occur
    ; ... etc.

[homes]
    ; this section specifies information related to how users on other
    ;    systems can have home directories under the same username on
    ;    the Red Hat system
    comment = Home Directories
    browseable = no
    read only = no
    create mode = 0750
    ; ... etc.

[printers]
    path = /var/spool/lpd/lp
    ; make sure the above directory is correct and writable by the 
    ;    guest account you've specified above in the general section
    browseable = yes
    printable =  yes
    public = yes
    writable = no
    create mode = 0700
    Postscript = true  
    ; if you have a Postscript printer
    ; ... etc.

; other specific sections follow ...

Again, make sure that you create the guest account on the Linux system which you specified in the general section above (e.g. pcguest).

You will need to create sections in smb.conf for any particular shares which you want to create. For example, if I want to share a DOS partition on my Red Hat system, the section in smb.conf could look like:

[dos_disk]
    comment = DOS partition on Red Hat System (/dev/hda1)
    path = /mnt/dos_c
    ; location of Red Hat system partition you want to share
    public = yes
    writable = yes
    printable = yes
    ; ... etc.

If you want to print to your standard lp queue on your Red Hat system, you will not need to set up any specific sections for printers, and instead you should just be able to use the general [printers] section. However, if you want to use multiple print queues or make other changes to the default printer setup, you may want to add other print services. See the original smb.conf for examples of how to do this.

If you still have questions on the server setup or if problems occur when you try accessing services on your Red Hat system, look at the Samba Server web page at http://lake.canberra.edu.au /pub/samba/docs/smb_serv/html/smb_se.html (which is a quite comprehensive document on setting up the server and on getting Samba connections to work in general).

If you use a workgroup name other than LANGROUP, you will need to modify the command that starts the nmbd daemon. Edit the file /etc/rc.d/init.d/smb and change the line that says:

daemon nmbd -D

to:

daemon nmbd -D -G your-group-name

e.g.:

daemon nmbd -D -G mynet

This will allow ``browsing'' of available services on your Red Hat system from a Windows client system (i.e. you'll be able to choose a Red Hat system acting as a server and see what shared resources are available).


Next Previous Contents