Allowed resources
You can use on-line sources, but you can't communicate with any one else.
Getting started
Start by executing the following three commands. From now on we will refer to sysadminexam2 as the “quiz directory”.
mkdir sysadminexam2 chmod 700 sysadminexam2 cd sysadminexam2
Tasks and Questions
Task 1
Use the setfacl command to set the permission of your sysadminexam2 directory so that the user
brock
has read and execute permission to the directory.
Task 2
Open the editor of your choice in another window. Create a file called answers.txt (or answers.odt if you are using something like LibreOffice) in the quiz directory to store, when appropriate, answers to the exam questions.
Question 3
What does it mean to have “execute” permission on a directory?
Question 4
Write regular expressions using the grep syntax, that match lines containing the following:
- Lines with at least one instance of the character ‘b’.
- Lines with exactly one instance of the character ‘b’. (Be careful.)
- Lines containing the two-word phrase “computer science” where the two words can be separated by one of more characters of whitespace and either words can be capitalized.
Question 5
Use the find, perhaps with grep, command to list all the files or directories within the directory /home/brock/csci372 meeting the following criteria.
- List all directories.
- List all files whose names end with “.html”.
- List all files whose names end with “.html” that also contain the string “guru”.
Question 6
What is the purpose of the following three files within the .ssh directory.
- authorized_keys
- id_rsa
- id_rsa.pub
Yeah. You probably can get the answer off the web.
Task 7
Create a subdirectory STUFF in your quiz directory and create an empty (0 character) file inside it.
Task 8
Use the dd command to copy the first 100000 bytes of both /dev/zero and /dev/urandom to your STUFF directory. Call these two files zero.bytes and urandom.bytes. Be sure to verify that both of these files are exactly 100000 bytes long.
Task 9
Using either zip or gzip, compress your zero.bytes and urandom.bytes files.
Question 10
What is the size of your two compressed files? Why do you think there such a large difference? You may want to read the first paragraph of the descriptions obtained by executing the following two commands before giving your answer.
- man 4 zero
- man 4 urandom
Task 11
Store a listing of the /etc directory in your STUFF directory.
Task 12
Connect back to your quiz directory and use tar to create an archive of your STUFF directory.
Task 13
Use od to display, in ASCII, the eight characters that start at byte 265 of your STUFF.tar archive file.
Question 14
What were those eight characters? (This is mostly for those who had trouble with Task 12, but can use other means to get this information.)
Question 15
The C++ compiler is started with the command g++. What is the name of the file in which the C++ compiler is really stored? I’m looking for the name of the real file, not the name of the symbolic link. (Be glad I didn’t ask where the Java compiler is stored.)
Question 16
Why does the directory /etc/rc5.d have all those symbolic links?
Question 17
When creating and mounting a logical volume, you may need to type the following six commands:
- fdisk
- lvcreate
- mkfs
- mount
- pvcreate
- vgcreate
List these six commands in the order you would most likely invoke them. Give examples of the arguments you might would use with these commands.
Trivial task 18
ZIP (or tar) a copy of your sysadminexam2 directory and upload it to moodle.
Trivial task 19
Change the protection of the file you created in task 18 so that only you can read it.