- Download Sites and Methods
- Before Upgrading an Existing Server
- Compiling Samba
- What Goes Where When I Type make install?
- Binary Distribution Methods
- Summary
- Q&A
Before Upgrading an Existing Server
Before you begin compiling and installing the latest version of Samba, it is a good idea to make sure that all the important configuration files from an existing installation are safe. If you are installing a Samba server from scratch, you can skip this section and continue directly to the section "Compiling Samba." However, the same set of files that should be protected during an upgrade should be protected against a server crash. The information in this section can help you to formulate a good backup plan for your server's configuration data.
If you are unsure what version of Samba is currently installed on your server, the easiest means of getting this information is to use the -V switch for either the smbd or nmbd binary. These two programs together compose Samba's server implementation. The following command shows that the version of Samba installed on the server is 2.2.0. Note that /usr/local/samba/bin/ is just one of the places where smbd can be installed. The /usr/sbin/ and /usr/local/sbin/ directories are also common locations.
$ /usr/local/samba/bin/smbd -V Version 2.2.0
Backing Up Important Files
Samba's configuration data can be broken up into two categories: (1) configuration files such as smb.conf and (2) user account information such as the smbpasswd file or a username map.
Of course, it is always a good idea to keep a set of known working binaries from the previous installation in case the upgrade needs to be rolled back. If you are using some type of software-packaging system, such as RPMs, then just make sure that you keep a copy of a known working package. Otherwise, you need to manually back up the Samba programs and tools. We cover the Samba binaries in detail later in this chapter, so it might be a good idea to read ahead in order to familiarize yourself with these.
The majority of Samba's configuration information is maintained in a text file generally named smb.conf. In addition to smb.conf, other smaller pieces of data should be protected as well. Table 3.1 lists the most important configuration files, their purpose, and their possible locations.
Table 3.1 Samba Configuration Files
Filename |
Description |
Possible Locations |
---|---|---|
smb.conf |
This text file contains the majority of Samba's configuration data. |
/etc/, /etc/samba/, /etc/samba.d/, /usr/local/samba/lib/ |
MACHINE.SID |
The workstation identifier (SID). This file is created by smbd at startup if it does not exist, which can cause problems if Samba is part of a Windows NT domain (or controlling one). In Samba 2.2, this information was moved to the secrets.tdb file. |
/etc/, /etc/samba/private/, /etc/samba.d/private, /usr/local/samba/private |
secrets.tdb |
This file contains the machine trust account password when Samba is configured as a domain member server. in Samba 2.2, it also contains the information formally stored MACHINE.SID. |
/etc/samba/private, /etc/samba.d/private, /usr/local/samba/private |
ntdrivers.tdb |
This database contains all the configuration data to support "Point and Print" features for Windows clients. In Samba 2.2.2, this file was replaced by three files: ntforms.tdb, ntprinters.tdb, & ntdrivers.tdb. |
/var/lock/samba, /usr/local/samba/var/locks |
Although the configuration files in Table 3.1 exist on all Samba servers, certain files containing user account information may not. The existence of these files depends on whether or not certain features of Samba have been enabled. Table 3.2 lists the Samba-specific user account files and the smb.conf parameters that must be enabled for the files to be used.
Table 3.2 Samba-Specific User Account Information
smb.conf Parameter |
Filename |
Description |
---|---|---|
username map = <filename> |
The actual filename is given by the value of the username map parameter. |
A mapping of Windows usernames to Unix usernames. |
encrypt passwords = yes smb passwd file = <filename> |
The default name is smbpasswd. Alternative names can be defined using the smbpasswd file parameter |
The smbpasswd file contains the LM and NT password hashes used to support SMB password encryption. |
All of these files are covered in greater detail in later hours. Tables 3.1 and 3.2 are provided simply to help you avoid trouble early on; these necessary files should not be deleted.