Securing-Optimizing-RH-Linux-1_2_427
Comments and suggestions concerning this book should be mailed to gmourani@videotron.ca
© Copyright 1999-2000 Gerhard Mourani and Open Network Architecture ®
427
echo -n "Shutting down SMB services: "
killproc smbd
RETVAL=$?
echo
echo -n "Shutting down NMB services: "
killproc nmbd
RETVAL2=$?
[ $RETVAL -eq 0 -a $RETVAL2 -eq 0 ] && rm -f /var/lock/subsys/smb
echo ""
;;
restart)
$0 stop
$0 start
RETVAL=$?
;;
reload)
echo -n "Reloading smb.conf file: "
killproc -HUP smbd
RETVAL=$?
echo
;;
status)
status smbd
status nmbd
RETVAL=$?
;;
*)
echo "Usage: $0 {start|stop|restart|status}"
exit 1
esac
exit $RETVAL
Now, make this script executable and change its default permission:
[root@deep /]# chmod 700 /etc/rc.d/init.d/smb
Create the symbolic rc.d links for Samba with the command:
[root@deep /]# chkconfig --add smb
Samba script will not start automatically the smbd and nmbd daemon when you reboot the server.
You can change it default by executing the following command:
[root@deep /]# chkconfig --level 345 smb on
Start your Samba Server manually with the following command:
[root@deep /]# /etc/rc.d/init.d/smb start
Starting SMB services:
[ OK ]
Starting NMB services:
[ OK ]
Configuration of the /etc/pam.d/samba file
Configure your /etc/pam.d/samba file to use pam authentication.
Create 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
Configuration of the /etc/logrotate.d/samba file
Configure your /etc/logrotate.d/samba file to rotate each week your log files automatically.