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’.
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