The Samba Web Administration Tool (SWAT)

Current Samba packages include an all-in-one GUI configuration utility, the Samba Web Administration Tool (SWAT). As we mentioned earlier, it s included in the samba-swat-* RPM package.

Before you can run SWAT, you must activate the corresponding xinetd daemon with the following command:

 # chkconfig swat on 

SWAT includes several menus , which we ll look at in the following sections. Briefly, once you make your desired configuration changes in each menu, you ll click the Commit Changes button to write the changes to file.

Once you ve completed the changes, you must restart the smbd and nmbd daemons, either through the SWAT Service menu or with the service smb restart command.

The Home Menu

To start SWAT, open the browser of your choice and navigate to localhost:901 . Even if you re logged in as the root user , SWAT prompts you for an authorized username and password. Once you enter that information, SWAT starts with the Home menu, shown in Figure 29.10.

click to expand
Figure 29.10: The SWAT Home menu

As you can see, the SWAT Home menu includes links to other SWAT menus on the top row. We ll examine each menu in the following sections. The Home menu also includes access to a number of Samba documents. Some are man pages associated with specific commands or files. Toward the bottom of the document list are Samba HOWTOs and a copy of the first edition of Using Samba , in e-book format.

Samba Configuration Wizard

SWAT s Samba Configuration Wizard provides a way to address three basic settings for your Samba server. Click the Wizard link and scroll down to see the options shown in Figure 29.11.

click to expand
Figure 29.11: The Samba Configuration Wizard

Let s take a look at each of these options:

Server Type Allows you to select from one of three types of servers on a Microsoft-based network: Stand Alone, Domain Member, or Domain Controller (PDC or BDC). If you re connecting to a Microsoft peer-to-peer workgroup, stand-alone servers are your only valid option.

Configure WINS As Lets you specify the role of WINS on your network. There are three choices: you can configure your Samba server as a WINS server; you can configure it as a client of a different WINS server, if you know its IP address; or you can avoid the use of WINS on your network.

This is associated with the wins server and wins support variables .

Expose Home Directories Permits users to see the directories associated with their Linux usernames. This option is associated with the [ homes ] share we described earlier in this chapter.

Once you ve made your selections, click the Commit button. This may not be the Configuration Wizard that you expect; you have a lot more work to do before you can start your Samba server. Click the Globals link at the top of the menu and continue on to the next section.

The Globals Menu

You can configure the [global] settings in your smb.conf file through the Globals menu. Click the link, and you should see a menu similar to the one shown in Figure 29.12.

click to expand
Figure 29.12: SWAT global variables

As you can see, a Help option is associated with each variable. Clicking Help opens the smb.conf man page in a new browser window, at the section with the desired variable.

In this and each of the other menus, you ll have access to the following three buttons : Commit Changes, Reset Values, and Advanced View. With individual settings, you ll also see a Set Default button. Their functions are summarized in Table 29.8.

Table 29.8: Basic SWAT Option Buttons

Button

Description

Commit Changes

Writes the changes you make to smb.conf

Reset Values

Restores the current values in smb.conf to the menu

Advanced View

Provides additional settings

Set Default

Activates the default setting associated with the variable

If you ve read the Samba Global Settings section earlier in this chapter, several of the settings should look familiar to you. While I won t repeat the discussion of each variable, the way the variables are organized can help you understand how global settings work. These categories are listed in Table 29.9. Some of these categories appear only after you click the Advanced View button.

Table 29.9: Global Variable Categories

Category

Description

Base

Specifies the basic options for the Samba server.

Security

Allows you to configure passwords, user accounts, and computers that are allowed to connect.

Logging

Lets you customize how and where information is logged.

Protocol

Customizes interaction with different Windows protocols.

Tuning

Permits you to optimize the performance of the Samba server.

Printing

Sets the basic print protocol; the standard Linux options are cups and lprng .

Filename Handing

Allows you to set how short and regular filenames are transferred between computers.

Domain

If you re configuring this computer as a domain controller (PDC or BDC), this allows you to set administrative and guest groups.

Logon

If you re setting up this Samba server as a logon controller, this allows you to configure logon and script file locations.

Browse

Configures the priority of this computer for the Microsoft browse list of shared directories and printers.

WINS

Sets basic options for using WINS and DNS servers.

Locking

Files are locked to prevent multiple users from writing to the same file simultaneously .

MSDfs

Allows the use of the Microsoft Distributed Filesystem tree.

Winbind

Works with the / etc/nsswitch.conf file for resolving computer hostnames.

When you ve completed your changes, don t forget to click the Commit Changes button to record them in smb.conf . Click the Shares link at the top of the menu and continue to the next section.

Tip  

Each SWAT variable includes a Help hyperlink. Click this hyperlink to open up a new browser window with more information on that variable.

The Shares Menu

In the SWAT Shares menu, you can configure existing shares or create new ones. The initial Shares menu is shown in Figure 29.13; you need to select a share before you can customize it.

click to expand
Figure 29.13: The SWAT Shares menu

Existing shares are taken from the names listed in the smb.conf file; typical shares from the packaged smb.conf file include [homes] and [tmp] . Select an existing share and then click Choose Share.

Alternatively, you can configure a new shared directory. Enter the name of your choice in the Create Share text box, and then click Create Share to get to the full Shares menu, shown in Figure 29.14.

click to expand
Figure 29.14: Configuring share parameters

This illustrates the share parameters associated with the [homes] shared directory. We described all of these variables earlier in this chapter. If you prefer, click the Advanced View button for more configuration options.

When you ve completed your changes, don t forget to click the Commit Changes button to record them in smb.conf . Now click the Printers link at the top of the menu and continue to the next section.

The Printers Menu

The SWAT Printers menu is similar to the Shares menu. You can choose to configure an existing printer, or you can create a new printer. Once you ve made your selection, click the Choose Printer or Create Printer link. Individual options under the Choose Printer drop-down text box are read from /etc/printcap . Remember, both CUPS and LPD list their printers in this file. Once you ve made your selection, you can customize different printer variables, as shown in Figure 29.15.

click to expand
Figure 29.15: SWAT Printer Parameters

When you ve completed your changes, click the Commit Changes button to record them in smb.conf . Now click the View link at the top of the menu and continue to the next section.

The View Menu

The SWAT View menu gives you a look at your smb.conf configuration file. You ll note that all of the comments and most of the settings from the original smb.conf file are deleted. If a variable is set to its default value, it isn t included in the normal view, similar to what s shown in Figure 29.16.

click to expand
Figure 29.16: The saved smb.conf file

However, if you click the Full View button, you ll see an smb.conf file in full glory , with all available variables. You can then click the Normal View button to return to the current file. At this point, click the Password link at the top of the menu and continue to the next section.

The Password Menu

The SWAT Password menu lets you manage the Samba passwords stored on the local Samba server, as well as manage passwords on remote computers. As you can see in Figure 29.17, this menu consists of two sections.

click to expand
Figure 29.17: Managing passwords

Server Password Management

The Server Password Management section allows you to manage your Samba passwords, which are sent when you try to connect to a remote Samba or Microsoft Windows server. The buttons shown in Figure 29.17 are fairly self-explanatory; they are listed in Table 29.10.

Table 29.10: Server Password Management Functions

Function

Description

Change Password

Allows you to change the Samba password for Samba users; each user must already exist in /etc/passwd .

Add New User

Adds a new user to /etc/samba/smbpasswd; the user must already exist in /etc/passwd; however, this is not as flexible as the smbadduser command described earlier.

Delete User

Deletes the user from /etc/samba/smbpasswd .

Disable User

Prevents the user from connecting to remote Samba or Microsoft Windows servers.

Enable User

Allows the user to connect to remote Samba or Microsoft Windows servers.

Client/Server Password Management

This section actually allows you to change your password on a remote Microsoft Windows or Samba server. In the example shown back in Figure 29.17, I changed the password for user mjang on a computer named experimental running Microsoft Windows 2000 .

This won t work if Samba can t find the name of your computer in /etc/ hosts , DNS, or possibly WINS. It also won t work if the username does not exist on the remote computer. Now click the Status link at the top of the menu and continue to the next section.

The Server Status Menu

Once users start to connect from other computers to your Samba computer, you ll want to check your server status. As an example, Figure 29.18 shows a Samba server with connections from other computers named rh9server and laptop2, with private IP addresses.

click to expand
Figure 29.18: Server Status

This is where SWAT is an active administration tool. At the top of the screen, you can see that the status of each connection is refreshed every 30 seconds. You can stop or restart the smbd and nmbd daemons. Under Active Connections, you can review the status of connections from different computers. You can also disconnect remote users by clicking the appropriate X button in the Kill column.

Whenever you make changes to smb.conf , you should reload or restart the smbd daemon. When you restart smbd , nmbd is restarted automatically.

 


Mastering Red Hat Linux 9
Building Tablet PC Applications (Pro-Developer)
ISBN: 078214179X
EAN: 2147483647
Year: 2005
Pages: 220

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net