Lab Questions


Lab 1

1. 

In this first lab, you'll look at setting up automatic connections to a shared network directory. While this lab uses files described in Chapter 10, it is focused on shell configuration files. For the purpose of this lab, assume your username is vaclav and you're mounting a shared NFS /inst directory from a remote computer with an IP address of 192.168.30.4. You're going to mount it in vaclav's home directory, in a blank directory named inst.

  1. Select the regular user of your choice. That user should have files such as .bashrc and .bash_logout.

  2. Find a shared directory on a remote computer.

  3. Set up a local directory for that user as a mount point.

  4. Configure commands for that user to mount and umount that remote directory. Make sure those commands run only when that user logs into his or her account.

image from book

Answers

1. 

This lab has two purposes: it is designed to help you understand mounted network directories and the login process. You can substitute the user, the shared network directory, and directories of your choice. To some extent, the automounter described in Chapter 4 provides an alternative. If you have problems, more information on NFS is available in Chapter 10. But based on the premises in this lab, I would take the following steps:

  1. Log in as user vaclav. Create the specified directory. For this lab, you would use the mkdir/home/vaclav/inst command.

  2. Test the network connection. Mount the remote NFS directory on the directory that you just created. For this lab, use the following command (substitute the appropriate IP address or host name for your network):

     # mount -t nfs 192.168.30.4:/inst /home/vaclav/inst 

    If you have problems, review SELinux settings. If you're trying to connect from the root account, make sure no_root_squash is configured in the /etc/exports file of the NFS server. For more information, see Chapter 10. Firewalls and nonstandard ports can also be a problem.

  3. Run the mount command by itself. If you've successfully mounted to the shared directory, you should see it at the end of the list of mounted directories.

  4. Unmount the network connection. For this lab, you would use the following command:

     # umount /home/vaclav/inst 

  5. Add the commands specified from steps 2 and 4 to the local .bashrc and .bash_logout configuration files. Remember that since these files start with a dot, they are hidden.

  6. Test the result. Log out, and log back in. Check your mounted directories. If the command in .bash_logout does not work, you'll probably see the shared directory mounted multiple times.

Lab 2

2. 

In this lab, you will test the quotas created in this chapter. You'll use the basic quota settings described in this chapter and then copy files to fill up the home directory of a user who has a quota applied. The steps required for this lab are straightforward.

  1. Set up quotas on the local computer. Use the criteria described earlier in this chapter. If you don't have a separate /home directory partition, you can set up quotas on the top-level root directory (/).

  2. Once you've set quotas in your /etc/fstab configuration file, remember to remount the partition where you've created a quota. Alternatively, you could reboot Linux, but that would take time that you may not be able to spare during either of the Red Hat exams.

  3. Set up a quota for the user of your choice. Remember that when you use the edquota command on a specific user, you can edit the quota file directly using vi editor commands. Configure a hard and a soft limit for that user.

  4. Log in as the user with the quota. Copy some large files to the home directory of that user. To speed up this process, if you want to create an arbitrary large file, say 179MB, run the following command:

     # dd if=/dev/zero of=testfile bs=1k count=179000 

  5. Continue the copying process until you see a warning message. When you do, run the quota command. What do you see? Does anything in the output give you a warning that you've exceeded the quota?

  6. Copy some additional files until you see a "Disk quota exceeded" message. Run the quota command again. What do you see?

  7. Delete some files from that user's home directory-at least enough to get the files under the quota limits.

image from book

Answers

2. 

The purpose of this lab is to practice creating quotas for users. It's quite possible that you'll have to configure quotas on the Red Hat exams. While you may not have to test quotas in the way described in this lab, it will help you become familiar with the error messages that you'll see when you exceed a hard and then a soft quota limit.

Lab 3

3. 

In this lab, you'll create a private directory for a group of engineers designing some galleys. You'll want to create a group named galley for the engineers named mike, rick, terri, and maryam. They'll want to share files in the /home/galley directory. What do you need to do?

image from book

Answers

3. 

This is a straightforward process, using the following basic steps:

  1. Create accounts for mike, rick, terri, and maryam if required. You can use the useradd command, edit the /etc/passwd file directly, or work through the Red Hat User Manager.

  2. Set up a group for these users. Configure a group ID outside the range of your regular users with a line such as:

     galley::10000:mike,rick,terri,maryam 

  3. Create the /home/galley directory. Give it proper ownership and permissions with the following commands:

     # mkdir /home/galley # chown nobody.galley # chmod 2770 /home/galley 

Lab 4

4. 

You want to make sure even the root user has to enter the root password when opening Red Hat administrative tools. You can do this by modifying the appropriate file in the /etc/pam.d directory.

image from book

Answers

4. 

To make the lab work, first review the various system-config-* files in the /etc/pam.d directory. Most (except system-config-lvm and system-config-selinux) include the following three directives:

 auth         include      config-util account      include      config-util session      include      config-util 

They all point to the config-util file in /etc/pam.d directory. Open this file in the text editor of your choice. The first two commands allow users to start this tool automatically:

 auth    sufficient    pam_rootok.so auth    sufficient    pam_timestamp.so 

The first command checks whether you're the root user. The second command checks to see whether you've opened the given tool recently, based on the conditions of the pam_timestamp module. If you deleted (or commented out) these commands, all users, including the root user, will have to enter the root password when opening this tool. To do so, take the following steps:

  1. Open a typical tool such as the Red Hat Security Level Configuration tool in a command line in your GUI. Make sure it opens normally. When it does, close it without making any changes to your current firewall.

  2. Back up the current PAM module for config-util to your home directory:

     # cp /etc/pam.d/config-util ~ 

  3. Open the file in /etc/pam.d in the text editor of your choice. Comment out the first two commands in this file.

  4. Save the file. If you're not already logged into the GUI as the root user, log out of the GUI. Log back into the GUI as root.

  5. Try opening the Red Hat Security Level Configuration tool. What happens?

  6. Restore the original configuration. If you don't remember what you did, restore it from the config-util file in your home directory.



RHCE Red Hat Certified Engineer Linux Study Guide (Exam RH302)
Linux Patch Management: Keeping Linux Systems Up To Date
ISBN: 0132366754
EAN: 2147483647
Year: 2004
Pages: 227
Authors: Michael Jang

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