Post Installation

Installing SWAT

SWAT is the Samba Web Administration Tool, a program that can be used to administer samba via a web browser. Swat runs on it's own port and functions as a small web server. It does not have SSL capabilities. At the very least, you should limit who can connect with tcpwrappers. If you wish to use SSL, I would suggest installing webmin instead.

To use SWAT, you must add the following entry to /etc/services:

swat      901/tcp

You'll also need to add the following to /etc/inetd.conf

swat stream tcp nowait.400 root /usr/local/samba/bin/swat swat

Be sure to substitute /usr/local/samba/bin/swat with the actual path if you install samba in a different location. Now restart inetd and you may access SWAT by pointing your web browser at http://host:901.

Starting Samba

Samba can be started by manually running the smbd and nmbd daemons in the samba bin directory. Below is the init.d script I use to start and stop samba

#!/bin/sh
#
# chkconfig: 345 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

# See how we were called.
case "$1" in
  start)
	echo -n "Starting SMB services: "
	daemon smbd -D 	
	echo
	echo -n "Starting NMB services: "
	daemon nmbd -D 
	echo
	touch /var/lock/subsys/smb
	;;
  stop)
	echo -n "Shutting down SMB services: "
	killproc smbd
	echo
	echo -n "Shutting down NMB services: "
	killproc nmbd
	rm -f /var/lock/subsys/smb
	echo ""
	;;
  restart)
	echo -n "Restarting SMB services: "
	killproc smbd -HUP
	echo
	echo -n "Restarting NMB services: "
	killproc nmbd -HUP
	echo
	;;
  status)
	status smbd
	status nmbd
	;;
  *)
	echo "Usage: smb {start|stop|restart|status}"
	exit 1
esac

On systems with chkconfig, simply call this file smb and stick it in /etc/rc.d/init.d. Then at the command line type chkconfig -a smb and it will be setup to start at boot.