Skip to main content

SAMBA – The SWAT web admin tool on Ubuntu

By October 20, 2013No Comments

In this tutorial we show the example of how we can manage our samba server graphically with SWAT, the SAMBA Web Administration Tool. Not only can we manage samba with the GUI but it is consistent across distributions rather then using YaST on SUSE that is SUSE specific. We use Ubuntu to demonstrate this on as it requires a little more work tan other distributions as they do not automatically add in the xinetd config file.

To start we need to install SAMBA, SWAT and the XINETD which manages SWAT.

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

With the installation in place we can movie intot he /etc/xinted.d directory and create a configuration for SWAT. XINTED is a master service that can control and manage smaller services such as swat. We need to tell XINETD about the SWAT service and this is the purpose of the file we create /etc/xinetd.d/swat

service swat
    disable        = no
    socket_type    = stream
    user        = root
    wait        = no
    port         = 901
    server        = /usr/sbin/swat
    log_on_failure     += USERID

Once we have saved this we can restart the xinetd

service xinetd restart

If we check the output from netstat we should be able to see the service listening on port 901 and being held open by the xinetd

netstat -pant

We have to authenticate to SWAT to be able to manage the samba server. If we want to use members of the adm group not just root then we set the permissions accordingly on the /etc/samba/smb.conf

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

I can now log onto SWAT as my account which is a member of the adm group in Ubuntu. I just need to point my browser to

Or at least that is the address of my server. From here we can easily create shares and view setting. As a member of the adm group and can manage the server but no samba users. Root can do that. Or I can use the command line

To list samba users I can use

sudo pdbedit -L

and to add new users

sudo smbpasswd -a andrew

Now I can connect to the shares I have created from my Windows client.