The Red Hat exams are unique based on their reliance on labs and hands-on demonstrations. With these questions, you're practicing the skills you need on both Red Hat exams.
1. | This lab assumes you have a new hard disk (or at least empty space on a current hard drive where you can add a new partition). You can simulate a new hard disk by adding appropriate settings to a VMware or Xen virtual machine. In this lab, you'll create a new partition using parted, format it, transfer the files currently on your /home (or if you don't have a lot of space, /tmp) directory to that partition, and revise /etc/fstab so the new partition is properly mounted the next time you boot Linux. If you have a limited amount of available space, dedicate only half of it to this lab and leave the other half empty for Lab 2. |
|
Answers
1. |
|
2. | In this lab, you'll add a new swap partition using the fdisk utility. Remember to make the partition work with the appropriate file type, and then format and activate it. Make sure it's properly included in /etc/fstab so this partition is used the next time you boot Linux. |
|
Answers
2. | In this lab, you'll add a new swap partition using the fdisk utility. Remember to make the partition work with the appropriate file type, format, and activate it. Make sure it's properly included in /etc/ fstab so this partition is used the next time you boot Linux.
|
3. | In this lab, you'll configure the automounter on your computer on an NFS connection, using two different methods. You'll need a second computer with Linux or Unix installed, and a shared NFS directory. You can use the shared NFS installation source created in Chapter 2 or any other shared NFS directory described in Chapter 10. A virtual machine such as a VMware computer qualifies as a second computer.
|
|
Answers
3. | Configuring the automounter on a shared NFS directory is easier than it looks. Before you begin, make sure that you can mount the shared NFS directory from the remote computer. Resolve those problems first before beginning this lab. Refer to Chapter 2 on creating an NFS installation server or Chapter 10 on NFS for more information. If there's no problem with a source on an NFS server with an IP address of 192.168.30.4, you should be able to mount it locally. For example, you can mount a shared remote NFS /inst directory on an existing empty local /test directory as follows:
# mount -t nfs 192.168.30.4:/inst /test Whatever you do, it's important to back up any files that you're about to edit. In this case, there are two configuration files that should be backed up: /etc/auto.master and /etc/auto.misc. Make sure the following directives are active in /etc/auto.master:
/misc /etc/auto.misc /net -hosts In /etc/auto.misc, the following commented directive provides a template for one way to connect to a shared NFS directory:
#linux -ro,soft,intr ftp.example.org:/pub/linux When active (remove the #), this would mount the NFS share /pub/linux from ftp.example.org on the /misc/linux directory. Substitute accordingly. Based on the conditions described in the lab, you would substitute test for linux, 192.168.30.4 for ftp.example.org, and test for /pub/linux. Now you can restart the autofs server; the quickest way is with the following command:
# service autofs restart Now when you test the result, you should be able to see the contents of the shared NFS directory from the remote system with both of these commands:
# ls /misc/test # ls /net/192.168.30.4/ You can test the result in a different way. Once you've connected to all available systems, the following command should reveal the systems with available NFS shares:
# ls /net 192.168.30.4 Please, retry this lab with other shared NFS directories. |
4. | In this lab, you'll configure access for the supervisor named Donna to the project.odt OpenOffice .org writer file in John's home directory, /home/john. Remember that you'll need to remount the appropriate partition, revise /etc/fstab, change permissions to /home/john, and set the ACL permissions to allow access by Donna. |
|
Answers
4. | As described in this chapter, you'll first have to change the mount of the filesystem with the /home directory to include ACL settings. For example, if /home isn't mounted separately from the top level root (/) directory and is part of /dev/VolGroup00/LogVol00, you can remount the filesystem with the /home directory with the following command:
# mount -o remount -o acl /dev/VolGroup00/LogVol00 / Needless to say, you'll also want to add acl to the appropriate line in /etc/fstab; it might look like this (obviously, it varies with the partition, mounted directory, and LABEL):
/dev/VolGroup00/LogVol00 / ext3 defaults,acl 1 1 Now with these settings, allow others to execute in John's home directory:
# chmod 701 /home/john Now you can set ACLs to allow Donna access to John's home directory:
# setfacl -m user:donna:r-x /home/john/ # setfacl -m mask:r-x /home/john/ Next, configure individual files with ACLs. The file in question is project.odt in John's home directory. Deny access to all users but the owner:
# chmod 700 /home/john/project.odt To check the result, log into your own account and try opening abc from Donna's home directory. You should see the [permission denied] message. Now set read-write permissions in the ACLs for the project.odt file with the following commands:
# setfacl -m user:donna:rwx /home/john/project.odt # setfacl -m mask:r-x /home/john/project.odt Now user Donna can do what she needs with the project.odt file in John's home directory. You can confirm the changes with the getfacl /home/john/project.odt command. To simplify the test process, you can use a separate console to log into Donna's account. If you're working from the administrative root account, you can log into Donna's account with the su - donna command. |