| < Day Day Up > |
|
1. | Part 1: Installing and Starting Samba
|
|
2. | Part 2: Configuring Samba's Global Settings
|
|
3. | Part 3: Configuring File Shares
|
|
4. | Part 4: Setting Up Printer Shares
|
|
5. | Part 5: Verifying the smb.conf File
|
|
6. | Part 6: Starting the Samba Servers
|
|
7. | Part 7: Persistency Check It is important for your server (and critical to pass the RHCE exam) that any changes you make to your server should be persistent. This means that changes should be active when you reboot Linux. Perform an orderly reboot of your server now and verify that Samba starts when you boot Linux.
|
|
Answers
1. | The first chapter lab on Samba is designed to be easy to follow. However, you'll need explicit Linux knowledge to complete some specific steps. Answers to these steps can be found in the following: |
2. | Step 1: You've installed the Windows File Manager package group, which includes the samba-client, samba, and redhat-config-samba RPMs. These RPMs depend on the samba-common RPM, which you'll also need to install. Step 2: You can use the chkconfig --level 35 smb on command or the Service Configuration utility described in Chapter 4 to make sure Samba starts the next time you boot Linux. Step 3: Use the service smb start command to begin the Samba service. Step 4: One way to verify Samba is to look for the existence of the smbd and nmbd processes in the process table. Use ps aux | grep mbd to see if these processes are present. Another way is with a service command such as service smb status. |
3. | Step 1: To use the Samba Server Configuration tool, you'll need the root password. Step 2: Many administrators stick with the default Microsoft Windows workgroup name of WORKGROUP. You can find it in the output from the smbclient -L //clientname command. Step 3: If you want to limit access to your Samba server, you can't do it through the Samba Server Configuration tool. You'll want to set up the hosts allow command in /etc/samba/smb.conf. Step 4: If you want to restrict access from a specific computer to your Samba server, you can't do it through the Samba Server Configuration tool. You'll want to set up the hosts deny = evil crackers.com command in /etc/samba/smb.conf. Step 5: When you exit the Samba Server Configurator, or save the smb.conf file, you can make Samba read the changes with the service smb reload command. But before committing the changes, you should test them with the testparm command. |
4. | Step 1: Open the main Samba configuration file, /etc/samba/smb.conf, in a text editor. Step 2: Navigate to the [homes] share in the last half of this file. Step 3: Unless there is a limitation in the Globals part of this file, you can limit the [homes] share with the hosts allow = example.com. Commit your changes. Restart or reload smb under the Status menu or with the appropriate service command. Step 4: Add a guest ok = no to the [homes] stanza. Step 5: Save the changes you've made so far. Step 6: At the end of the file, start a [public] stanza. Add an appropriate comment for the stanza. Step 7: Set path = /home/public. Save your changes to the smb.conf file. Step 8: Make sure to set hosts allow = example.com. Step 9: Set permissions for the public share, with the following commands: # mkdir /home/public # chmod 1777 /home/public Create a new directory, /home/public; configure that share in SWAT and call it public. Set the hosts allow setting in SWAT under the Shares menu, and list the domain associated with your network. Deny to all others. Step 10: The 777 aspect of permissions grants read, write, and execute/search permissions to all users (root, root's group, and everyone else). The 1 at the beginning of the permission value sets the sticky bit. This bit, when set on directories, restricts users from deleting or renaming files they don't own. Step 11: Commit your changes with the service smb reload command. |
5. | Step 1: Open your /etc/samba/smb.conf configuration file. Navigate to the [printers] stanza. The default version of this stanza should already enable access to all users who connect. Step 2: In this stanza, use the hosts allow command as before. Step 3: Commit your changes by closing and saving the smb.conf file, and then running the service smb reload command. |
6. | Step 1: You can use the Samba syntax checker, testparm, to make sure there are no glaring problems to your Samba configuration file. Step 2: This is more of an exercise; if you don't have any problems, you might want to deliberately add some to your smb.conf file and rerun testparm again. It's helpful to be familiar with different kinds of Samba syntax issues. Don't forget to restore a working version of the smb.conf file! |
7. | Step 1: Again, this is more of an exercise than a lab. The steps are generally self-explanatory. If your Samba configuration is successful, you should be able to review browseable shares from a Microsoft Windows computer on the same LAN. |
2. | In this lab, you'll want to use the Red Hat Printer Configuration utility to connect a printer to your Linux system. The printer can be local or remotely connected through your LAN. As you'll want to create a printer class, you'll need more than one printer. If you have only one physical printer, you can set up multiple print queues with different printer names. CUPS sees each print queue as if it were a separate printer. Once you've created multiple printers, open a GUI Web browser. Navigate to http://localhost:631. Click the Class link and then click Add Class. Follow the prompts to create a printer class with the printers that you've configured. Once you've created a new printer class, inspect the result in the /etc/cups/classes.conf configuration file. Check the contents of your /etc/printcap file. What are the names of the printers that you see? Are there any surprises in the list? If you have a Microsoft Windows computer on your network, activate the Samba service if required. Check the printer names as shown in the browse list. Are there any surprises on this list? |
|
Answers
2. | Step 1: To complete many Linux configuration changes, you need to make sure that the service will start automatically when you reboot your computer. In general, the key command is chkconfig. In this case, the chkconfig --level 35 smb on command sets up the smbd daemon to become active when you boot Linux into either runlevel 3 or runlevel 5. Step 2: The command you should always use to perform an orderly shutdown is shutdown -r now. Starting the Printer Configuration utility is easy. One way in the GUI is to click Main Menu | System Settings | Printing. Then you can click the Add button to start what is known in the Microsoft world as a configuration wizard. If you like, you can create two different print queues with the same printer. Just repeat the same process, using a different printer name. Open the Web browser of your choice. The default is Mozilla, which you can start in the GNOME desktop by clicking the globe icon adjacent to the Main Menu icon. You can then navigate to http://localhost:631. Once the CUPS Web-based tool opens, you can click the Classes or the Manage Printer Classes link. Click Add Class in the Class Web page. Enter the root username and password when prompted. Enter the single-word name of your choice for the printer class name. Add the name or IP address of the computer in the Location text box. Enter the comment of your choice in the Description text box. Click Continue; select more than one computer as members of the printer class. Click Continue; once your new printer class is confirmed, you can close the browser. You should now see the printer class and member printers in the /etc/cups/classes.conf file. You'll find a list of printers in /etc/printcap; you'll find the names of any configured printers and printer classes in this file. You should also see the list of printers in /etc/printcap in any Microsoft Windows Network Neighborhoods or My Network Places that is connected to the same network. This assumes that you've activated a Samba server on the local print server computer, of course. |
| < Day Day Up > |
|