Sams Teach Yourself Samba in 24 Hours

ContentsIndex

Hour 9: GUI Administration Tools

Previous HourNext Hour

Sections in this Chapter:

 

Hour 9
GUI Administration Tools

by Richard Sharpe

In the previous four hours, you have looked at configuring Samba in some detail. However, this took the form of delving through many of the configuration parameters that can appear in your smb.conf file and required that you be able to edit that file with your favorite editor.

Those who are experts in Samba configuration no doubt find that directly editing the smb.conf file is the quickest way to add new shares or change settings. For many people, though, a simple GUI interface to the smb.conf file would be a boon. Such a facility is even more useful if you need to make only a simple change, and you are not physically logged onto the Samba server.

In this hour you explore the following GUI configuration tools for Samba, some in more detail than others:

These tools can be broadly divided into three groups:

In the following sections, you will explore the installation and use of most of these tools and discuss the advantages and drawbacks of each.

SWAT

Managing the [global] Section

Obtaining Status Information

Managing File Shares

Viewing the Complete smb.conf File

Managing Printer Shares

Changing Your Password

The Samba Web Administration Tool (SWAT) is a new facility with Samba 2.0.0. It is a miniature Web server and CGI scripting application designed to run from inetd that provides access to the smb.conf file on the system that SWAT is running on. inetd is the daemon that handles the startup of most network servers under UNIX and is controlled by the file /etc/inetd.conf. (For more details on inetd, try man inetd.)

SWAT enables a suitably authorized person (with the root password) to configure all aspects of Samba via Web pages. SWAT also places help links to all configurable smb.conf options on every page, which lets administrators easily understand the effect of any changes.

SWAT is built and installed by default under Samba 2.0.0, but depending on the system you are on and the installation method, you might have to do some additional configuration to use SWAT.

If you are installing Samba from RPM on a Linux system, RPM does all the necessary configuration (including the changes mentioned later). However, if you use more manual methods, you need to complete the following steps:

Note - If you use NIS, you probably need to rebuild your NIS service maps.

Note - If you have installed your Samba binaries somewhere else, you need to change this directory to the appropriate directory.

When you have completed these steps, you should be able to use your favorite browser to access SWAT. To do this, visit your Samba server on port 901 by going to http://your-server:901/.

When your browser has contacted SWAT, you are presented with an authorization dialog box asking for your username and password. You must enter a sufficiently privileged user here, such as root. Figure 9.1 shows how you would use a browser to access SWAT on EAGLE.

Note - In using SWAT you are sending your username and password in plain text over the network. It is not a very good idea to enable people to use SWAT to administer your Samba server remotely over the Internet, as they must send usernames and passwords in the clear over the Internet.

Figure 9.1
Accessing SWAT from a browser.

When you have logged in, you are presented with the main SWAT page, shown in Figure 9.2, which enables you to choose from among the following areas:

Figure 9.2
The SWAT home page.

At any time you can return to the SWAT home page by clicking on the Home icon.

SWAT should work on any operating system that Samba runs on, whereas some of the other configuration tools mentioned in this hour are more restrictive.

The following sections discuss each of the configuration pages you can access.

Managing the [global] Section

When you select the Globals icon, SWAT returns with a Web page that enables you to modify many of the most relevant Samba global parameters. The Web page returned is shown in Figure 9.3. The Samba global variables are grouped into related options.

Figure 9.3
SWAT enables you to modify parameters in the Globals section.

Clicking the Advanced View button brings up the same set of groups of related options, but you can now edit all of them.

To make a change, simply scroll down to the parameter you want to change, enter the new value, and then click the Commit Changes button.

Managing File Shares

When you select the Shares icon, SWAT returns a Web page that enables you to create new shares and modify existing shares. The page returned is shown in Figure 9.4.

Figure 9.4
Creating and modifying shares with SWAT.

To modify any of the parameters of an existing share, select the share from the dropdown list next to Choose Share and click Choose Share. You are presented with the page shown in Figure 9.5.

To create a new share, enter its name in the field next to the Create Share button and then click Create Share. You then are presented with a page similar to that shown in Figure 9.5, with the name of your new share as the choice in the first field.

Note - You should notice that Figures 9.4 and 9.5 contain the same fields at the top of the page. That is, they both contain the Choose Share and Create Share buttons. These enable you to choose a new share to view or create a new share without going back to the SWAT home page. Simply enter the name of the share you want to view and click Choose Share.

Figure 9.5
Modifying or creating a share via SWAT.

From this page you can

If you need to modify parameters not shown on this page, click the Advanced View button and modify the appropriate parameters.

The Advanced View page shows all the parameters related to the selected share, grouped in the following sections:

When you have made all the changes you need, click Commit Changes, and they are made to the share. Samba immediately makes the changes you choose.

Managing Printer Shares

When you select the Printers icon, SWAT returns a Web page that enables you to create new printers and modify existing printers. The page returned is shown in Figure 9.6.

Figure 9.6
Creating and modifying printers with SWAT.

To modify an existing printer, select it from the dropdown list next to Choose Printer and then click Choose Printer. You are presented with the page shown in Figure 9.7.

To create a new printer, enter the name of the printer in the field next to Create Printer and click Create Printer. You are presented with a page similar to that shown in Figure 9.7 with the name of your new printer in the first field.

Figure 9.7
Modifying or creating a printer via SWAT.

From this page you can

If you need to modify parameters not shown on this page, click the Advanced View button and modify the appropriate parameters.

When you have made all the changes you need, click Commit Changes and they are made to the share. Samba immediately makes the changes you choose.

Obtaining Status Information

When you select the Status icon, SWAT returns a Web page that provides status about Samba, as well as enabling you to stop and restart the Samba daemons. It also enables you to disconnect active users. The Web page SWAT returns is shown in Figure 9.8.

Figure 9.8
The SWAT status page.

The status page also provides a means of having it refreshed on a continual basis. Simply specify the refresh interval and click Auto Refresh.

Viewing the Complete smb.conf File

When you select the View icon, SWAT returns a Web page that displays the whole smb.conf file. The page returned is shown in Figure 9.9.

Figure 9.9
The smb.conf file.

SWAT lists the Samba config as it appears in the smb.conf file. If you want a listing that includes the values of all the parameters that Samba maintains, simply click the Full View button.

Changing Your Password

If you select the Password icon, SWAT returns a Web page where you can modify your password on the Samba server that SWAT is running from or change your password on another CIFS/SMB server elsewhere in your network. You can also add users, disable users, or enable users. The page returned is shown in Figure 9.10.

Figure 9.10
Changing your password with SWAT.

Note - SWAT operates only on your smbpasswd file, not on your normal UNIX password files.


Sams Teach Yourself Samba in 24 Hours

ContentsIndex

Hour 9: GUI Administration Tools

Previous HourNext Hour

Sections in this Chapter: