How to Install and Configure SWAT (Samba Web Administration Tool) In Ubuntu Server 12.04

in File Server, How To

SWAT (Samba Web Administration Tool) is an simple web-based configuration application allow you to configure and manage the samba configuration file (smb.conf) via web browser. this is a GUI utility for configuring Samba, and it can be very helpful for new Ubuntu administrators who need to get Samba up and running quickly.

On Ubuntu Server 12.04 LTS, SWAT package installation is available in official ubuntu repository. So, if you install Samba Server, SWAT is automatically installed as well. When you install some Linux distributions, you need to option to select packages and then make sure you choose to install the SWAT package installation.

Follow the guide How to install and Configure Samba Web Administration Tool in Ubuntu Server 12.04

Install and Configure Samba Web Administration Tool

Login on your ubuntu server machine via ssh, install samba, swat and  xinetd

sudo apt-get instal samba smbfs samba-doc swat xinetd

Enable service SWAT in /etc/xinetd.conf and restart with the new configuration.

sudo update-inetd --enable 'swat'
sudo dpkg-reconfigure xinetd

Create new configuration file /etc/xinetd/swat:

sudo cat > /etc/xinetd/swat <<-EOF
# 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
# Use only_from if you want to restrict access
#      only_from = localhost 192.168.56.1
       user = root
       server = /usr/sbin/swat
       log_on_failure += USERID
       disable = no
}
EOF

Change the permissions smb.conf to group administrator (adm).  use ‘chmod’ and ‘chgrp’ tools to change the file access permissions and group permissions respectively:

sudo chmod g+w /etc/samba/smb.conf
sudo chgrp adm /etc/samba/smb.conf

Restart service xinetd with following command:

sudo /etc/init.d/xinetd restart

or

sudo service xinetd restart

From a different client on your network,open your web browser and access http://samba_server:[port] ex (http://192.168.56.2:901).  If successful, you will be presented with a dialog box asking for username and password. Use the username and a password from the admin group to log in, and you’ll have access to SWAT.

Link Reference:

Advertisement:
  • Oliver Salzburg

    You misspelled “install” in the first command line. Also, you might prefer to switch to invoke-rc.d to restart services. Over all, great guide. Saved me quite some time :)

    As a side note, smbfs was replaced by cifs-utils in 12.10.

    Thanks!

Previous post:

Next post: