Linux - Samba - The Samba Web Administration Tool (swap)

1 - About

SWAT is a web-based application that help to configure Samba. Swap is installed with the installation of samba.

3 - How to

3.1 - Get the version

You can verify the installation by performing this command : swat -?

[[email protected] ~]# swat -?
Usage: swat [OPTION...]
  -a, --disable-authentication       Disable authentication (demo mode)
  -P, --password-menu-only           Show only change password menu

Help options:
  -?, --help                         Show this help message
  --usage                            Display brief usage message

Common samba options:
  -d, --debuglevel=DEBUGLEVEL        Set debug level
  -s, --configfile=CONFIGFILE        Use alternate configuration file
  -l, --log-basename=LOGFILEBASE     Base name for log files
  -V, --version                      Print version

swat answer with the help message.

3.2 - Locate it

[[email protected] ~]# whereis swat
swat: /usr/sbin/swat /usr/share/swat /usr/share/man/man8/swat.8.gz


[[email protected] ~]# find / -name swat -print

3.3 - Enable it

To enable it, you must modify the file swat located in /etc/xinetd.d/swat by setting no in front of the disable option as :

# default: off
# description: SWAT is the Samba Web Admin Tool. Use swat \
#	       to configure your Samba server. To use SWAT, \
#	       connect to port 901 with your favorite web browser.
service swat
        port            = 901
	socket_type     = stream
	wait            = no
	only_from       = localhost
	user            = root
	server          = /usr/sbin/swat
        server_args     = -a
	log_on_failure += USERID
	disable         = no


  • port is the port of the web administration tool
  • server is the location of the swat binary (locate it)
  • server_args are the argument of the server. Here -a to disable authentication ;-)
  • disable must set to no to enable

It's a control file with the new style xinetd.

In order to launch your modification, you must restart the xinetd Linux - Service client.

[[email protected] ~]# service xinetd restart
Stopping xinetd:                                           [  OK  ]
Starting xinetd:                                           [  OK  ]

Once the restart is successful, Swat is accessible via the web-address http://localhost:901. You have to login with the root user.

4 - Support

By default, xinetd use SYSLOG to log the message. Then to debug, just restart xinetd and check the messages log with the command below.

tail -f /var/log/messages

Example of problem that you can found:

Jun 12 18:54:27 di-obia-01 xinetd[9696]: Bad value for wait: on [file=/etc/xinetd.d/swat] [line=9]
Jun 12 18:54:27 di-obia-01 xinetd[9696]: Error parsing attribute wait - DISABLING SERVICE [file=/etc/xinetd.d/swat] [line=9]
Jun 12 18:54:27 di-obia-01 xinetd[9696]: attribute server expects 1 values and 2 values were specified [file=/etc/xinetd.d/swat] [line=12]
Jun 12 18:54:27 di-obia-01 xinetd[9696]: Must specify a server in swat

5 - Documentation / Reference

Data Science
Data Analysis
Data Science
Linear Algebra Mathematics

Powered by ComboStrap