CIS 112 Chapter 8 Test
The human resources team uses the /hr directory to keep important employee documents. Over time, you notice that permissions set on each file have become inconsistent. You want to make sure that all files in the /hr directory have the same permissions settings. You must modify the file permissions to be -rw-rw---- (the octal equivalent of 110 110 000 = 660). Complete this lab from the Terminal. In this lab, your task is to: Configure permissions on all files in the /hr directory as follows: User and group owners should have Read and Write permissions to the files. All other users should have no permissions on any file. Use the ls command to verify your changes.
chmod 660 /hr/* ls -la /hr
A change in company policy requires users in the hr group to make changes to the files in the /hr directory. Complete this lab from the terminal. In this lab, your task is to: Give the Write group permission to the files in the /hr directory in addition to any existing permissions. Use the ls command to verify the changes.
chmod g+w /hr/* ls -la /hr
The Sales team uses the /sales directory to store documents related to sales, contacts, and orders. Currently, permissions on the directory only allow the user and group owners to view the contents of the directory. Users who are not part of the group owner are unable to list the contents of the directory. As part of a new company policy to increase teamwork, you want to allow all users to be able to see the /sales directory and list its contents. You also want to let all users open any document inside that directory, but you do not want them to make changes to the documents. Complete this lab from the Terminal. In this lab, your task is to: Allow the group other to browse the /sales directory. Modify permissions on all files in the /sales directory to allow members of the other group to view the files, but prohibit them from changing them.
chmod o+rx /sales chmod o+r /sales/*
You have a Linux workstation, which you use at home for browsing the internet, playing music, and writing letters. When you run your MP3 player, it sometimes pauses in playback. You have heard that you might be able to alleviate the problem by raising the priority of the program. You decide to set the SUID bit to automatically run the program as root and, thereby, raise its priority. Complete this lab from the Terminal. In this lab, your task is to: Set the SUID bit for the /usr/bin/xmms program. Do not change any other permissions on the file.
chmod u+s /usr/bin/xmms chmod 4755 /usr/bin/xmms
You have a Linux workstation that you use at home. You are the only person that uses this computer. You want to improve security by removing the SUID and SGID from some files. Complete this lab from the Terminal. In this lab, your task is to: Remove the SUID from the following files:/usr/bin/gpasswd/usr/bin/newgrp Remove the SGID from the following files:/usr/bin/wall/usr/bin/write Leave permissions on the files as they are.
chmod u-s /usr/bin/gpasswd chmod u-s /usr/bin/newgrp chmod g-s /usr/bin/wall chmod g-s /usr/bin/write
During a random security audit, you found that the user and group ownership for the /hr directory is set to Will Adams (wadams). For security reasons, you need to change the ownership. You want to give ownership to Brenda Cassini (bcassini), the office manager, and you want to give group ownership to the hr group for all the files in the directory. After you do this, you need to reset group ownership on the /hr/personnel file to mgmt1. Complete this lab from the Terminal. In this lab, your task is to: Give bcassini ownership of the /hr directory and all of its contents. Give the hr group ownership of the /hr directory and all of its contents. Return group ownership of the /hr/personnel file to mgmt1.
chown -R bcassini:hr /hr chgrp mgmt1 /hr/personnel
Listen to simulation instructions You are concerned that you may be getting low on disk space. You want to check and see if that assumption is correct. Complete this lab from the Terminal. In this lab, your task is to: Use the applicable command to view the current disk space in human readable form.To find the correct option, use man command. Answer the questions.
df -h How much space is used on dev/sda2? - 2.9G How much space is still available on /dev/sda2? - 1.1G What percentage of space is used on /dev/sda1? - 52%
You are logged on as Will Adams (wadams), and your working directory is /home/wadams. You need to know some information about the disk usage for Will's home directory. Complete this lab from the Terminal. In this lab, your task is to: Use the applicable command to view the disk usage for the /home/wadams directory. Answer the questions.
du Answer Questions. (remember that /home/wadams directory is 100k big)
Users have complained that the seven-day default grace period for soft limits is too short. Complete this lab from the Terminal. In this lab, your task is to: Increase the block and file (inode) grace period for users from 7 to 30 days. Generate a quota report to confirm the changes.
edquota -u -t Type nano and press Enter to open the editor. Move the cursor under Block grace period and delete the 7. Type 30. Move the cursor under Inode grace period and delete the 7. Type 30. Press Ctrl + x to exit the editor. Press the y key to save your changes. Press Enter. repquota -a
Sam Chan (schan) has reached his user quota limit, and he wants more space. Your manager has approved an increase in his quota limit. Complete this lab from the Terminal. In this lab, your task is to: Increase the hard and soft block limits on the schan user account to 1048576 KB (1 GB). Generate a quota report to confirm the changes.
edquota -u schan Type nano and Enter to open the editor. Move the cursor under soft and delete 9216. Type 1048576 (use the Delete key to take out any extra spaces caused by the insertion). Move the cursor under hard and delete 10240. Type 1048576 (use the Delete key to take out any extra spaces caused by the insertion). Save the changes. Press Ctrl + x to exit the editor. Press the y key to save your changes. Press Enter repquota -a
You are thinking about adding another disk to your system. To help you make your decision, you want to view the current setup. Complete this lab from the Terminal. In this lab, your task is to: View the disk information for your system. Answer the questions.
fdisk -l Which physical disk is the boot on? - 1st Which disk partition is the boot disk on? - 1st Which physical disk is the swap area on? - 1st Which disk partition is the swap area on? - 5th What is the beginning cylinder for the swap area? - 62191 What is the allocated size of the swap area (in blocks)? - 473632
The wadams user needs access to a file in the /sales folder on your system, but does not belong to the sales group. In this lab, your task is to use ACL utilities to: Check the permissions on the /sales/forecast.txt file. Grant full rights for the /sales/forecast.txt file to wadams.
getfacl /sales/forecast.txt setfacl -m u:wadams:rwx /sales/forecast.txt getfacl /sales/forecast.txt
You suspect that one of the storage devices on your system has failed. Your need to identify which device it is. In this lab, your task is to: Find out if a device has failed.Use the appropriate command to list devices and their utilization.Answer the question.
iostat Which device (if any) has failed? - All devices seem to be working properly.
Brenda Cassini (bcassini) is taking over payroll documentation for Will Adams (wadams). In this lab, your task is to give the bcassini user ownership of the /hr/payroll file.
ls -l /hr/payroll chown bcassini /hr/payroll ls -l /hr/payroll
The CEO of the company wants to make sure that the employees' personal information, as stored in the /hr/personnel file, is protected. The CEO has asked that you make sure that the human resources (HR) department is the owner of that file. Complete this lab from the Terminal. In this lab, your task is to: Find the current owner of the /hr/personnel file. Answer the question. Change the group ownership of the /hr/personnel file to the hr group. Verify the ownership change.
ls -l /hr/personnel chgrp hr /hr/personnel ls -l /hr/personnel Which group is the current owner of the /hr/personnel file? - mgmt1
You are the IT administrator for this Linux system. Your manager has asked you to verify the ownership of a few files and directories. Complete this lab from the Terminal. In this lab, your task is to: View the ownership for the /sales/orders file.Answer Question 1. View the ownership for the /projects/darkhorse file.Answer Question 2. View the ownership for the /projects directory.Answer Question 3. View the ownership for the /hr directory.Answer Question 4.
ls -l /sales/orders ls -l /projects/darkhorse ls -l / Who owns the /sales/orders file? - bcassini Who is the group owner of the /projects/darkhorse file? - proj Who owns /projects directory? - bcassini Who is the group owner of the /hr directory? - sales
An assistant administrator has been modifying permissions on the /hr directory. You want to quickly change the permissions on /hr to match the permission settings documented in your company's security policy. You must modify the directory permissions to be drwxr-xr-x (the octal equivalent of 111 101 101 = 755). Complete this lab from the Terminal. In this lab, your task is to: Determine the current permissions for the /hr directory. Answer the question. Modify the permissions on the /hr directory as follows:User: Read, Write, ExecuteGroup: Read, Execute Other: Read, Execute
ls -la /hr chmod 755 /hr ls -l / What are the current permissions for the /hr directory? - rwxr--r--
You've installed a third hard drive (sdc) and created two partitions on the drive. Now you need to format both partitions. Complete this lab from the Terminal. In this lab, your task is to: Format the two partitions with the ext4 file system.
ls /dev/sd* mkfs.ext4 /dev/sdc1 mkfs.ext4 /dev/sdc2
On your Linux system, you have installed a second hard drive and created one partition on the drive. You have also installed a third hard drive and created two partitions on that drive. You now want to create a logical volume using the first partition on each new drive. Complete this lab from the Terminal. In this lab, your task is to: Use pvcreate to initialize the partitions for use with LVM. Use vgcreate to create a volume group named data using these two partitions. Use lvcreate to create a 1-terabyte logical volume named art from the data volume group. Create a directory named product where you can mount the new logical volume. Format the new logical volume with ext4. Mount the logical volume to the product directory. Change to the product directory and create a file named newproduct. Verify the creation of the file and amount of disk space available on this new volume.
ls /dev/sd* pvcreate /dev/sdb1 /dev/sdc1 vgcreate data /dev/sdb1 /dev/sdc1 vgs lvcreate --size 1t -n art data mkdir product mkfs.ext4 /dev/data/art mount -t ext4 /dev/data/art product cd product touch newproduct ls df -h
You are considering adding an additional hard disk to your system. Before doing so, you need to find out what block devices are connected to your Linux system. Complete this lab from the Terminal. In this lab, your task is to: Use the appropriate tool to list the block devices on your system. Answer the questions.
lsblk How many physical storage devices are connected to the system? - 2 Which partition is mounted as /home? - sda3
You recently installed and formatted a new hard drive in your system. Its device file name is /dev/sdb1. Now you want to mount the volume. Complete this lab from the Terminal. In this lab, your task is to: Create the /mnt/disk directory. Mount /dev/sdb1 to the /mnt/disk directory with the ext3 file system. Use the mount command to verify that the volume is mounted correctly.
mkdir /mnt/disk mount -t ext3 /dev/sdb1 /mnt/disk mount
You've installed a new hard drive and created a partition on the drive. You now need to format the partition before you can save data on the new hard drive. Complete this lab from the Terminal. In this lab, your task is to: Format the /dev/sdb1 partition with the ext3 file system.
mkfs.ext3 /dev/sdb1 and press Enter.
You recently upgraded your computer and added an extra 512 MB of RAM. Consequently, you want to increase your swap space by adding a new swap area. The second hard disk has an unused partition (/dev/sdb2) that you want to format for the swap area. Complete this lab from the Terminal. In this lab, your task is to: Create a swap partition on /dev/sdb2. Activate the swap partition.
mkswap /dev/sdb2 swapon /dev/sdb2
You are logged on as the root user. Will Adams (wadams) has forgotten the system quotas that you configured for him. He has asked that you remind him. Complete this lab from the Terminal. In this lab, your task is to: Use the applicable quota command to view Will's quotas. Answer the questions.
quota -u wadams What is the blocks quota? - 18432 What is the blocks limit? - 20480 What is the files quota? - 500 What is the files limit? - 550
The system is running hard disk quotas for users and groups. Complete this lab from the Terminal. In this lab, your task is to: Disable the quotas on the root directory (/).
quotaoff /
To prevent users from using too much disk space, you have implemented hard and soft quotas on the root directory (/). Today, you noticed that the quotas are turned off. Complete this lab from the Terminal. In this lab, your task is to: Re-enable quotas for users and groups on the root directory (/).
quotaon /
You are an IT administrator for your company's Linux system. You need to generate a quota report for your supervisor regarding the quota usage for the system. Complete this lab from the Terminal. In this lab, your task is to: Use the applicable command to generate a quota report for all filesystems. Answer the questions.
repquota -a Which user does not have a quota limit? - root What is the hard block li it for most users? - 10240 What is the soft block limit for most users? - 9216 What is the highest hard block limit? - 20480 Which user has the highest hard block limit? - wadams
An employee in another department recently provided several important files for your current assignment. The files are compressed in a tar file. You need to extract each file so you can begin to use them. Complete this lab from the Terminal. In this lab, your task is to: Extract the files in /proj_files.tar.gz into the /projects directory. Answer the question.
tar -xzf /proj_files.tar.gz -C /projects ls -l /projects Which files were extracted from the tar file? - evals, history, records, temps
You need to create a backup copy of the /sales directory. You have decided to use tar to create the backup. Complete this lab from the Terminal. In this lab, your task is to: Create a compressed archive of the /sales directory and all of its contents.Name the file /salesbkp.tar.gz and save it in the root directory (/).
tar -zcf /salesbkp.tar.gz /sales
You want to change your default umask to give yourself and members of the groups to which you belong full permissions to the files and directories you create. You want to deny permissions for everyone else. You are logged on as wadams. Complete this lab from the Terminal. You cannot create a file with execute permissions. You can only create a directory with execute permissions. After a file is created, its permissions can be changed to include execute. In this lab, your task is to: Change your default umask value to give yourself and members of the groups to which you belong full permissions to the files and directories that you create.
umask umask 007 umask What is the current umask value? - 0022
The /dev/sdb2 volume is mounted to an uncommon mount point directory, /root/newdrive. You need to remove the volume from the /root/newdrive mount point and remount it to the /mnt/drive2 directory. Complete this lab from the Terminal. In this lab, your task is to: Unmount /dev/sdb2 from /root/newdrive. Mount /dev/sdb2 to /mnt/drive2. Use the mount command to verify that the volume is mounted correctly.
umount /root/newdrive mount /dev/sdb2 /mnt/drive2 mount