How to Install SWAT to Configure Samba from Web browser on CentOS 6.2

SWAT is a Samba Web Administration Tool. SWAT is a facility that is part of the Samba suite. SWAT allows a Samba administrator to configure the complex smb.conf. In this post, i will share on how to install and configure SWAT to Configure Samba on linux CentOS 6.2 server.

1. Run this command to install samba SWAT :

[root@centos62 ~]# yum install xinetd samba-swat -y
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.ipserverone.com
 * extras: centos.ipserverone.com
 * updates: centos.ipserverone.com
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package samba-swat.i686 0:3.5.10-114.el6 will be installed
--> Processing Dependency: samba = 3.5.10-114.el6 for package: samba-swat-3.5.10-114.el6.i686
--> Processing Dependency: samba-winbind-clients = 3.5.10-114.el6 for package: samba-swat-3.5.10-114.el6.i686
--> Processing Dependency: libwbclient.so.0 for package: samba-swat-3.5.10-114.el6.i686
---> Package xinetd.i686 2:2.3.14-33.el6 will be installed
--> Running transaction check
---> Package samba.i686 0:3.5.10-114.el6 will be installed
--> Processing Dependency: samba-common = 3.5.10-114.el6 for package: samba-3.5.10-114.el6.i686
---> Package samba-winbind-clients.i686 0:3.5.10-114.el6 will be installed
--> Running transaction check
---> Package samba-common.i686 0:3.5.10-114.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================
 Package                          Arch            Version                     Repository       Size
====================================================================================================
Installing:
 samba-swat                       i686            3.5.10-114.el6              base            3.0 M
 xinetd                           i686            2:2.3.14-33.el6             base            121 k
Installing for dependencies:
 samba                            i686            3.5.10-114.el6              base            5.0 M
 samba-common                     i686            3.5.10-114.el6              base             13 M
 samba-winbind-clients            i686            3.5.10-114.el6              base            1.1 M

Transaction Summary
====================================================================================================
Install       5 Package(s)

Total download size: 22 M
Installed size: 81 M
Downloading Packages:
(1/5): samba-3.5.10-114.el6.i686.rpm                                         | 5.0 MB     03:00
(2/5): samba-common-3.5.10-114.el6.i686.rpm                                  |  13 MB     07:32
(3/5): samba-swat-3.5.10-114.el6.i686.rpm                                    | 3.0 MB     01:40
(4/5): samba-winbind-clients-3.5.10-114.el6.i686.rpm                         | 1.1 MB     00:38
(5/5): xinetd-2.3.14-33.el6.i686.rpm                                         | 121 kB     00:03
----------------------------------------------------------------------------------------------------
Total                                                                30 kB/s |  22 MB     12:57
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : samba-winbind-clients-3.5.10-114.el6.i686                                        1/5
  Installing : samba-common-3.5.10-114.el6.i686                                                 2/5
  Installing : samba-3.5.10-114.el6.i686                                                        3/5
  Installing : 2:xinetd-2.3.14-33.el6.i686                                                      4/5
  Installing : samba-swat-3.5.10-114.el6.i686                                                   5/5

Installed:
  samba-swat.i686 0:3.5.10-114.el6                    xinetd.i686 2:2.3.14-33.el6

Dependency Installed:
  samba.i686 0:3.5.10-114.el6                           samba-common.i686 0:3.5.10-114.el6
  samba-winbind-clients.i686 0:3.5.10-114.el6

Complete!

2. Open swat configuration file :

[root@centos62 ~]# vi /etc/xinetd.d/swat

3. Add IP address you permit. In this example, i will add 192.168.1.0/24 network and enable swat by set ‘disable’ to ‘no’.

See also  How to Install CentOS 5.7 Server Part 1

Original configuration file :

# 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       = 127.0.0.1
        user            = root
        server          = /usr/sbin/swat
        log_on_failure  += USERID
        disable         = yes
}

Change to :

# 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       = 127.0.0.1 192.168.1.0/24
        user            = root
        server          = /usr/sbin/swat
        log_on_failure  += USERID
        disable         = no
}

4. Start xinetd service :

[root@centos62 ~]# /etc/rc.d/init.d/xinetd start
Starting xinetd:                                           [  OK  ]

5. Enable xinetd service auto start at boot :

[root@centos62 ~]# chkconfig xinetd on

How to Reset the Directory Manager Password on RHEL 7 / CentOS 7
How to Reset the Directory Manager Password on RHEL 7 / CentOS 7

It is best practice to remember passwords, but because too many passwords, sometimes we forget. We are not encouraged to write the password on any paper or share the password...

How to Find Big Files Size on Linux RHEL/CentOS
How to Find Big Files Size on Linux RHEL/CentOS

As the linux administrator, sometimes we have to identify which files are most take much space in the linux server resulting in low free space. Low disk space can also...

Why Linux users should worry about malware and what they can do about it
Why Linux users should worry about malware and what they can do about it

Don’t drop your guard just because you’re running Linux. Preventing the spread of malware and/or dealing with the consequences of infection are a fact of life when using computers. If...

How to Reset Forgotten Root Password on Linux RHEL 7 / CentOS 7
How to Reset Forgotten Root Password on Linux RHEL 7 / CentOS 7

This short howto will explain the steps to reset a lost root password or to reset a forgotten root password on Linux RHEL 7 or CentOS 7. Basically, we will...

How to Update CentOS or Upgrade CentOS to the Latest Version
How to Update CentOS or Upgrade CentOS to the Latest Version

Recently, the latest version of CentOS 7.3 was released. All users of CentOS 7.0, 7.1 and 7.2 can upgrade their system to the most recent. This quick guide will explain...

How to Change your WordPress Username, Nickname and Display Name in MySQL
How to Change your WordPress Username, Nickname and Display Name in MySQL

After you create an account log in WordPress, you may want to change your WordPress username, as appropriate or due to security reason. However, you can not do this from...

How to Enable SSH Root Login on Ubuntu 16.04
How to Enable SSH Root Login on Ubuntu 16.04

As what we wrote in the previous article on how to allow SSH root on Ubuntu 14.04, after installing a fresh new copy of Ubuntu 16.04 LTS, we find that...

How to Change UUID of Linux Partition on CentOS 7
How to Change UUID of Linux Partition on CentOS 7

UUID (Universally Unique IDentifier) should be unique and it is used to identify storage devices on a linux system. If you cloned a virtual machine from vCenter, the metadata containing...

Leave a Reply

Your email address will not be published. Required fields are marked *