Securing-Optimizing-RH-Linux-1_2_426
Comments and suggestions concerning this book should be mailed to gmourani@videotron.ca
© Copyright 1999-2000 Gerhard Mourani and Open Network Architecture ®
426
Configuration of 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).
Configuration of the /etc/rc.d/init.d/smb script file
Configure your /etc/rc.d/init.d/smb script file to start and stop Samba smbd and nmbd daemons
Server automaticaly.
Create the smb script file (touch /etc/rc.d/init.d/smb) and add the following lines:
#!/bin/sh
#
# chkconfig: - 91 35
# description: Starts and stops the Samba smbd and nmbd daemons \
#
used to provide SMB network services.
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0
# Check that smb.conf exists.
[ -f /etc/smb.conf ] || exit 0
RETVAL=0
# See how we were called.
case "$1" in
start)
echo -n "Starting SMB services: "
daemon smbd -D
RETVAL=$?
echo
echo -n "Starting NMB services: "
daemon nmbd -D
RETVAL2=$?
echo
[ $RETVAL -eq 0 -a $RETVAL2 -eq 0 ] && touch /var/lock/subsys/smb || \
RETVAL=1
;;
stop)