Written By:
Ying Zhang
Using SWAT
To enable SWAT, we have to check our /etc/services and /etc/inetd.conf
files. By default, SWAT runs from port 901. You can change this if you
like but for now let's leave it as is.
Let's check the /etc/services file for a line that looks like this:
swat 901/tcp # Add swat service used via inetd
If it's there then you're okay. If you don't see a line like that, add it
to the end of your services file. This is just a mapping that says "the
service called swat runs on tcp port 901".
Next we check the /etc/inetd.conf file for a line that looks like this:
swat stream tcp nowait.400 root /usr/sbin/swat swat
Securing SWAT
If you don't care about securing SWAT then you can skip this section, but
I feel much better having TCP wrappers protecting this guy, so I change
the line to look like this:
swat stream tcp nowait.400 root /usr/sbin/tcpd /usr/sbin/swat
If you don't know what TCP wrappers are, read the man pages:
# man hosts.allow
Now your /etc/hosts.deny should have a single line in it that says ALL:
ALL (it does right?). So we have to add this to your /etc/hosts.allow:
swat: 127.0.0.1 192.168.0.
This allows Homer, Bart, and Lisa to access SWAT.
Running SWAT
First let's restart inetd:
# killall -HUP inetd
Now with your favorite web browser go to the URL http://192.168.0.1:901.
If all goes well you should see a box pop up asking for a username and
password. For the username, enter in root, for the password enter your
root password.
Configuring Samba
Okay SWAT is up and running, go click on everything to familiarize
yourself with it. SWAT is a nice interface that creates the /etc/smb.conf
file for you. If you have an existing smb.conf it will clobber the
formatting and comments in it.
That's okay, because SWAT writes very nice and clean configuration files.
Anyhow instead of walking you through each screen in SWAT, I'm going to
cheat and just show you my /etc/smb.conf file instead. (The computer and
workgroup names have been changed to protect my system identities).
Take a look at this and simply copy it overtop of your existing
/etc/smb.conf. Make appropriate changes for your systems:
# Samba config file created using SWAT
# from bart (192.168.0.2)
# Date: 1999/01/16 15:57:15
# Global parameters
workgroup = SIMPSONS
server string = Samba SMB Server
nterfaces = 192.168.0.1/24 127.0.0.1/24
bind interfaces only = Yes
security = SHARE
log file = /var/log/samba/log.%m
max log size = 50
read bmpx = No
time server = Yes
socket options = TCP_NODELAY
os level = 65
preferred master = Yes
dns proxy = No
wins support = Yes
guest account = smbuser
hide dot files = No
[public]
comment = Public
path = /home/public
read only = No
create mask = 0664
directory mask = 0775
guest ok = Yes
[data]
comment = Data
path = /home/samba/data
read only = No
create mask = 0660
directory mask = 0770
guest ok = Yes
Starting Samba
You can start Samba one of two ways: using SWAT or from the command line.
It you want to use SWAT, go to the Status page and click start SMBD and
NMBD. If it was already started, click stop and start to restart it to
read your new configuration file.
To start from the command line:
# /etc/rc.d/init.d/smb stop
# /etc/rc.d/init.d/smb start
Okay, everything is running and you didn't see error messages, right?
Great! Let's give it a quick test.
Testing Samba
Okay, let's see if it's actually doing anything. Run:
# smbclient -L localhost
It might ask for a password, if so just press ENTER. You should now see
stuff resembling:
Domain=[SIMPSONS] OS=[Unix] Server=[Samba 2.0.3]
Sharename Type Comment
--------- ---- -------
public Disk Public
data Disk Data
IPC$ IPC IPC Service (Samba SMB Server)
Server Comment
--------- -------
HOMER Samba SMB Server
Workgroup Master
--------- -------
SIMPSONS HOMER
Everything's working? Great! Now all we have left is to configure your Windows boxes.
1 2 3 4
[-Previous Page-] [-Next Page-]
|