31.6. Configure the /etc/lmhosts file

Configure your /etc/lmhosts file. The lmhosts file is the Samba Net BIOS name to IP address mapping file. It is very similar to the /etc/hosts file format, except that the hostname component must correspond to the Net BIOS naming format.

Create the lmhosts file, touch /etc/lmhosts and add your client hosts:


        # Sample Samba lmhosts file.
        #
        127.0.0.1       localhost
        192.168.1.1     deep
        192.168.1.4     win
      
In our example, this file contains three IP to Net BIOS name mappings. The localhost, 127.0.0.1, client named deep, 192.168.1.1 and client named win, 192.168.1.4.

31.6.1. Configure the /etc/pam.d/samba file

Configure your /etc/pam.d/samba file to use pam authentication by creating the samba file, touch /etc/pam.d/samba and add the following lines:


        Auth      required        /lib/security/pam_pwdb.so nullok shadow
        Account required        /lib/security/pam_pwdb.so
      

31.6.1.1. Configure the /etc/logrotate.d/samba file

Configure your /etc/logrotate.d/samba file to rotate each week your log files automatically.

Create the samba file, touch /etc/logrotate.d/samba and add the following lines:


            /var/log/samba/log.nmb {
            notifempty
            missingok
            postrotate
            /usr/bin/killall -HUP nmbd
            endrotate
            }

            /var/log/samba/log.smb {
            notifempty
            missingok
            postrotate
            /usr/bin/killall -HUP smbd
            endrotate
            }