SAMBA Configuring NetBIOS Support in Linux

Overview of Samba

The Samba software that ships with Red Had 7.2 consists of three installation files. These files are stored in the /RedHat/RPMS directory on Disc 1 of the installation set. These installation files are listed below. These files are shipped in the RedHat Package Manager (RPM) format, making installation very easy.

To install Samba you first install the common library files. To do this, change to the /RedHat/RPMS folder on the installation CD and type the following.


[rpm –i samba-common-2.2.1a-4.i386.rpm]
[rpm –i samba-2.2.1a-4.i386.rpm]
[rpm –i samba-client-2.2.1a-4.i386.rpm]

What this installation did:

  • Created the /etc/samba directory which contains configuration files for the service, in particular the smb.conf file.
  • Created the ./smb script file in /etc/rc.d/init.d which is used to stop, start, and restart the service.
  • Added utility commands to /usr/bin. These commands begin with smb and can be viewed by typing [ls /user/bin/smb*].
  • Placed documentation in the /usr/share/doc directory.
  • Place kernel modules in the /lib/modules directory structure.

Samba configuration is done by editing the /etc/samba/smb.conf file. After making changes to this file, you need to restart the Samba service. To start an stop the smbd service (Samba Daemon), use the script file located in /etc/rc.d/init.d. Change to this directory and type [./smb start] an [./smb stop] to stop and start the service. Be sure to do this after making any changes to the smb.conf file, or those changes will not take effect.

Configuration of smb.conf

The smb.conf file has a simple syntax, similar to that of a Windows .ini file. There is a general configuration section called global, and a section for each share point. Consider the following sample configuration file.

[global]
workgroup = homenet
interfaces = 192.168.2.200/24
encrypt passwords = yes
security = user
smb passwd file = /etc/samba/smbpasswd
username map = /etc/samba/smbusers

[root]
guest ok = no
read only = no
path = /

This configuration reads as follows; The computer is a member of the workgroup “homenet”, and listens on the IP 192.168.2.200. Passwords are encrypted for Windows compatibility. User level security is in use, meaning special accounts need to be made to allow users to connect. Those accounts will be stored in the /etc/samba/smbusers file, with the corresponding passwords in /etc/samba/smbpasswd.

There is a single share point setup. It is called “root”, allows read/write access and is mapped to the root of the file system. This configuration, while not practical for corporate use, allows you to use Windows Explorer to navigate through your Linux file system.