record my way to ubuntu

Monday, January 01, 2007

Samba and Swat

Samba and Swat
Oddly enough, I think SWAT was never in the planes for Ubuntu.

I have no problem in setting things up manually, and scrubbing a few conf files till perfection... but I've realized it's a commom problem for most people.

Of course I've been through the usual steps, such as sudo apt-get samba samba-common smbfs smbclient swat

But for you to get swat to work, you will need to install a dependency beforehand apt-get install xinetd .

Then, sudo vi /etc/inetd.conf and uncomment the line:

## swat stream tcp nowait.400 root /usr/sbin/tcpd \ /usr/sbin/swat


Then make an entry for Swat under xinetd with sudo vi /etc/xinetd.d/swat

And it should look like this:

# description: SAMBA SWAT
service swat
{
disable = no
socket_type = stream
protocol = tcp
#should use a more limited user here
user = root
wait = no
server = /usr/sbin/swat
}


Then, sudo dpkg-reconfigure xinetd to restart with the new configuration.

Now the netstat -lt should echo something similar to this:

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 *:5666 *:* LISTEN
tcp 0 0 localhost:1026 *:* LISTEN
tcp 0 0 localhost:1027 *:* LISTEN
tcp 0 0 *:swat *:* LISTEN
tcp 0 0 localhost:mysql *:* LISTEN
tcp 0 0 *:netbios-ssn *:* LISTEN
tcp 0 0 *:10000 *:* LISTEN
tcp 0 0 *:1040 *:* LISTEN
tcp 0 0 *:munin *:* LISTEN
tcp 0 0 localhost:ipp *:* LISTEN
tcp 0 0 *:smtp *:* LISTEN
tcp 0 0 *:microsoft-ds *:* LISTEN
tcp6 0 0 *:2080 *:* LISTEN
tcp6 0 0 *:www *:* LISTEN
tcp6 0 0 *:ssh *:* LISTEN


Which indicates the swat service is running and listening to the correct 901 tcp port.

Remember to open the TCP port for the firewall if you are using any.

My iptables -L -v looks like that:

Chain INPUT (policy ACCEPT 1607 packets, 168K bytes)
pkts bytes target prot opt in out source destination
18688 3148K ACCEPT all -- any any anywhere anywhere state RELATED,ESTABLISHED
0 0 ACCEPT tcp -- eth0 any anywhere anywhere tcp dpt:ssh
0 0 ACCEPT tcp -- eth0 any anywhere anywhere tcp dpt:www
0 0 ACCEPT tcp -- eth0 any anywhere anywhere tcp dpt:microsoft-ds
18 3450 ACCEPT udp -- eth0 any anywhere anywhere udp dpts:netbios-ns:netbios-ssn
11 528 ACCEPT tcp -- eth0 any localnet/24 anywhere tcp dpt:swat
0 0 ACCEPT tcp -- eth0 any anywhere anywhere tcp dpt: x11
291 39656 ACCEPT udp -- eth0 any localnet/24 anywhere
0 0 ACCEPT icmp -- eth0 any localnet/24 anywhere
94 6728 ACCEPT all -- lo any anywhere anywhere
0 0 DROP all -- any any anywhere anywhere

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination

Chain OUTPUT (policy ACCEPT 2317K packets, 2125M bytes)
pkts bytes target prot opt in out source destination



You might be able to access http://<yourserver>:901/

No comments:

Followers