As with other network operating systems, you can share files and printers on a Linux computer. Linux actually provides a number of different ways that you can share resources on the network. For example, you can create an FTP server on any Linux computer and use it to serve up files to other users on the network. The easiest way to configure the FTP server is using the KWuFTPd utility on the KDE desktop. It allows you to configure anonymous and guest logons to the FTP server. Using an FTP server on the network allows you to provide files across different operating system platforms. The only software required on your client machines is a Web browser or other FTP client. Another alternative for sharing files is the use of Samba. You can deploy a Samba server that allows you to share files with Windows clients and other Linux computers on the network. Samba is pretty secure and provides encrypted password support and other security features. Linux computers on the network can be configured as both Samba servers and clients . For more about configuring and using Samba, see Chapter 6, "Configuring Peer-to-Peer Networks," in the section "Combining Linux and Windows." You can also share files on a Linux computer using the Network File System (NFS) . NFS was developed by Sun Microsystems and allows Linux computers to share files using a Virtual File System interface that runs on top of the TCP/IP protocol. Shared files can be manipulated by users as if the resources were stored locally on their computers. Let's take a look at configuring NFS on a computer running Red Hat. Configuring the Network File SystemNFS is a good example of a client/server environment where a Linux computer can be configured as both an NFS client and server. To configure the NFS server, you can use the NFS Server Configuration tool in a GUI environment such as Gnome or KDE. Directories that you share using NFS are referred to as shares. To open the utility from the KDE desktop, select the KDE menu, point at System Settings, and then select NFS Server. Figure 10.14 shows the NFS Server Configuration tool. Figure 10.14. You can configure the NFS server using the NFS Server utility.
To create a new share, follow these steps:
Once the share is configured, you must start the NFS service to make the share available. Click the Apply button in the NFS Server utility window. A message box will appear asking you if you wish to start the NFS service. Click Yes. You can also configure NFS shares using the command line or the Linuxconf GUI configuration tool. We will look at how a client browses for network resources such as NFS shares later in the chapter. Sharing PrintersProviding print services to network clients is one of the roles fulfilled by network servers. You can share local printers (a printer attached directly to the Linux server) on the network and also attach to remote printers. Linux workstations can access printers shared through Samba, Unix printers (local printers hosted by other Linux computers), NetWare printers, and printers connected directly to the network (direct connect printers). For an explanation of the basics of network printing see Chapter 7, "Network Operating System Overview." The most straightforward method of connecting to a local printer or configuring a remote printer in Red Hat is to use the Red Hat Printer Config utility. To open the utility from the KDE desktop, select the KDE menu, point at System Settings and then click Printing. To add a local or remote printer to the computer, select the New button in the utility window. The Add a New Print Queue dialog will open. You can click Forward to bypass the initial screen. On the next screen you enter a queue name for the new printer (the name is up to you, as long as the name begins with alphanumeric characters ) and then you select the queue type, as shown in Figure 10.17. Figure 10.17. Select the queue type for the new printer.
Once you select the type of queue, you are walked through the process of adding the printer. In the case of Local Printer, you will need to select the device that the computer is attached to, such as the parallel port (lp0) or a USB port. You then select the driver for the printer from a number of supplied drivers (there are a large number of drivers available for most of the popular printer manufacturers and their products). Once the driver is selected, you are ready to test the printer connection. In the case of remote printer connections such as Unix or Windows printers, you create a queue name as you do for a local printer and then you supply the name of the print server (the fully qualified domain host name for the computer that hosts the printer) and then select the appropriate print driver. No matter whether you are attempting to attach to a local or remote printer, the Add a New Print Queue dialog walks you through all the necessary steps. Once you have completed the configuration of the print queue, you can test your printer settings by clicking the Test menu in the Red Hat Printer Config window and selecting one of the test print jobs listed. You can make local printers available on the network using Samba, which is very useful in cases where there are Windows clients. However, in the case of a network that is made up of Linux servers and Linux clients, it is easier to configure the Linux clients with their default printer queue pointing to a remote printer hosted by another Linux computer. All you have to do is configure the print clients as we have discussed in this section using the Red Hat Printer Config utility. On the Linux computer that is serving as the print server for the printer (the computer that the printer is actually connected to), you will have to place a file named /etc/hosts.lpd that contains the IP address or hostname of each computer that should have print privileges for the printer. You will have to create this file as root (log in as the root account) and then you can create the file using any text editor supplied by Red Hat. Make sure that you save the hosts.lpd file in the etc directory on the computer that will provide the print services. Browsing for ResourcesYou will want to set up your Linux clients so that they can browse for shared files on the network. A client can browse for resources on the network using the Conqueror file/Web browser that is provided as part of the KDE desktop. Before a client begins to look for network resources, you might want to configure and enable Lisa on the system. "Lisa" is short for LAN Information Server. Lisa uses the TCP/IP protocol stack to create a network neighborhood in the Conqueror browser. Getting Lisa up and running is a two-step process. First, you can automatically configure Lisa using the LAN-Browsing KDE Control Module shown in Figure 10.18. To open the configuration utility on the KDE desktop, select the KDE menu, point at Preferences, then point at Network, and then select LAN Browsing. Figure 10.18. Configure Lisa automatically.
To auto-configure Lisa, click the Guided LISa Setup button. You will be walked through the process of configuring Lisa, including the way Lisa contacts other computers (Ping packets or NetBIOS broadcasts) and the range of IP addresses that should be contacted. After Lisa has been configured, you must start Lisa. All you have to do is open a terminal window and using the root account (type su and then the root password to operate as root in the terminal), type the command lisa . Lisa will be enabled. You can then browse the network from the computer using Konqueror. The easiest way to open Konqueror on the KDE desktop is to select the Home icon (which resides on the desktop). To browse the LAN, type lan://localhost in the Konqueror address box. Figure 10.19 shows the results of browsing a network with Lisa. A number of hosts appear in the Konqueror window. Figure 10.19. Browse the network with Lisa enabled.
To access any resources provided by a particular host, double-click to open the host icon. You can also browse specifically for Windows clients on the networks by typing smb:// computer name , where computer name is the host name of the Windows client. NFS shares on the network can be mounted from the command line using the mount command. To mount shares you must be enabled as root. Mounting a share basically takes the remote share and mounts it in an existing directory on the local machine. So, you need to have a mount point on the local machine, meaning a directory that can be hijacked to host the remote directory. When you mount the remote share to the local directory, you won't be able to get at any files that were originally in the local directory. So, you will probably want to create an empty directory on the local machine to specify as the mount point for the remote share. In a terminal window where you are logged in as root, you would use the following command to mount a remote share: mount hostname:/misc/project100 /project where hostname would be the name of the computer, such as popeye.spinach.com . The share being provided by popeye.spinach.com would be /misc/project100 , which identifies the exported NFS directory. The /project at the end of the command specifies the local directory that you want to use as the mount point for the remote share. After the share is mounted, you can use the Konqueror browser to locate the mount point directory. When the directory is opened on the local machine the remote files will be available. Tip
|