samba and swat

14 May

SAMBA AND SWAT

SWAT (Samba Web Administration Tool) is not installed as part of the Red Hat 9.0 Windows Networking selection. Selecting samba-swat as part of the Red Hat 9.0 installation (Check Individual Package Selection in the Package Group Selection, Tree View, Applications, System – added samba-swat) does not produce a working SWAT. The samba-swat RPM on the third Red Hat CD does not fully install.

Also, in a previous install, I installed the Server Configuration Tools and attempted to install Samba with Start, System Settings, Server Settings, Samba Server and encountered all sorts of problems. It insisted on using mygroup as a workgroup name and only implemented one of the user accounts. When I went into /etc/samba and edited smb.conf and manually entered the workgroup name, it showed-up in Windows with both workgroup names (after refreshing, etc.). SWAT is by far the best tool I’ve seen for configuring Samba and I have looked at most them. Hand editing the configuration file with gedit and entering samba user accounts and passwords at the command line in the terminal is the second best way.

More details on ways to install Samba with screen shots are presented in How to Network Red Hat Linux and Microsoft Windows. However, that article is presently based on RH 7.3 and the following procedures differ somewhat. In particular, see the article for an example of how to set-up a broadband (cable/DSL) router to work with this network configuration of RH Linux 9.0. The router configuration was not changed.

In Nautilus, right-clicked a blank area in /root, made new folder/directory, and named it RPM. Opened RPM and made a new folder: samba.

Used Mozilla to download the latest samba RPM (includes SWAT) to /root/RPM/samba

Note
This RPM, listed under Red Hat 8.0, works with Red Hat 9.0 and has/had the latest security fixes.

In Nautilus, double-clicked the file, samba-2.2.8a-1.i386.rpm, to install it. You may have to wait some for a response. Simple enough.

With Nautilus, went into /ect/samba, highlighted smb.conf (the samba configuration file), Edit, Duplicate, to make a back-up copy.

Edited the smb.conf file. In Mozilla highlight the text below starting with [global] and ending with bad user, right-click, copy.

[global]
netbios name = LINUX
workgroup = WORKGROUP
server string = Samba Server
hosts allow = 192.168.123. 127.
guest account = pcguest
security = share
encrypt passwords = yes
smb passwd file = /etc/samba/smbpasswd
unix password sync = Yes
passwd program = /usr/bin/passwd %u
passwd chat = *New*password* %nn *Retype*new*password* %nn *passwd:*all*authentication*tokens*updated*successfully*
pam password change = yes
obey pam restrictions = yes
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
[shared]
comment = Shared read/write directory for all LAN users and guests
path = /home/shared
public = yes
only guest = yes
writable = yes
printable = no
[homes]
comment = Home directories
browseable = no
writable = yes
valid users = %S
create mode = 0664
directory mode = 0775
map to guest = bad user

Right-clicked smb.conf and Opened it with gedit, Edit, selected Select All to highlight all of the text in the smb.conf file, right-clicked on the highlighted text, and selected Paste to overwrite it with the above text, and saved the file.

With Nautilus, went into /etc/xinetd.d, highlighted swat (the SWAT configuration file), Edit, Duplicate, to make a back-up copy.

Right-click, Open With, gedit, to edit it, and changed disabled = yes to disabled = no. Remarked-out only_from = 127.0.0.1 by putting a # in front of it like so:

# only_from = 127.0.0.1
This is so SWAT can be run from any PC on our LAN.

Saved swat.

Fired-up Services from the gnome panel, highlighted xinetd, Restart, and waited while xinetd finished restarting.

File, Refresh Services, and noted that swat was present and was checked. xinetd starts swat when it starts.

Checked and started smb, which is samba…

Tested swat … In the Mozilla, entered localhost:901 in the Address box, logged in as root and checked the remember values checkbox while doing so.

If you make a mistake logging-in, you may have to restart xinetd to get rid of the login error and to get the login prompt back.

SWAT is up.

Tested swat from my 2000 Pro computer… In the Windows Explorer, entered. http://192.168.123.1:901/ in the IE Address box. It can also be accessed with http://linux:901 once samba is up/host tables are installed (see below). Samba does not have to be running to use SWAT. SWAT modifies configuration files.

Used SWAT on from my Windows 2000 Pro computer to make the following samba accounts:

cbyard
jbyard
pcguest
root

It’s like this… Click the PASSWORD icon. You see root already filled-in for the User Name. Enter the password twice, click Add New User, click Enable User, replace root with the next user name, enter the password twice, Add New User, Enable, etc. You will see SWAT respond to each of these actions right under the Change Password button. I leave learning the rest of SWAT as an “exercise for the student.” You can use it from any PC on the network, along with the comments in the original samba configuration file you backed-up to modify the example Samba configuration, to suite you needs. Before using it, I would backup my working configuration files.

Test Samba

Start, Network Servers and you should see WORKGROUP in Nautilus. Double-click WORKGROUP and you should see the PCs that are active on the LAN and properly configured. Double-click a PC to see its shared drives, etc. That may require that you login to the PC. Another way to bring-up WORKGROUP in Nautilus is to type smb: in the Location box.

Right-click a text file on one of the disc shares, Copy File, pick a blank spot on the gnome desktop, right-click, Paste Files, and you should see its icon on the gnome desktop.

Went to Windows 2000 Pro computer opened My Network Places, Entire Network, Microsoft Windows Network, Workgroup with the Windows Explorer and linux was in the right window pane. Double-clicked and became listed in the left pane. It works the same way the first time for Comptuers Near Me. From Windows Me, the process is… Restart, Windows Explorer, My Network Places, Entire Network, Workgroup, and you should see linux. My Windows 2000 Pro computer did not require restarting. If this is the first login you will be prompted for your Samba Account/Password. You should not have to login in again after that.

Samba is up and the Linux host computer is networked with the other computers on the LAN. And that’s cool!