CS 302 a Final Exam with a Trick Question Or Two

CS 302 a Final Exam with a Trick Question Or Two

CS 302 – A Final Exam With a Trick Question or Two

1) On Euclid, what is the home directory for the user 'dwilder'?

2) Euclid is running portfix. Mail is sent at midnight from to . Mrs. Jerjovich does not read her mail until four hours have passed. She doesn't even check her mail for those four hours. Where was the mail stored for most of that time?

  1. On appletonhouse.org
  2. On graveret.edu
  3. It's traveling across the network.

3) What does the following script do?
#!/bin/bash
for i in /usr/bin/a*
do
mv $i $.bak
done

4) Heather's log /var/log/apache2/access_log has 10,000 lines, 20,000 words, and 100,000 bytes. How bytes did she send out via apache? ______

5) Barry's computer boots, and other people can log into to. However, when he logs into her computer, it logs him right back out. He says that it's probably because /bin/bash is missing and the other people must be using some other shell. Is this a reasonable guess?

6) Which file might Barry check to discover which shell he is set to run on login? ______

7) Andy T forgot to log out, and has left a root shell running while he visits the men's room. Andy B would like use this chance to annoy Andy T by destroy the contents of the Andy T's home folder every Sunday at 3am. Please suggest to him an appropriate cron line and an appropriate command to run.
Cron: ______
Command: ______

8) (Yes/No) Can Joel read this file? (Yes/No) Can I. The output of 'ls -l' is:
------r-- 1 rappleto rappleto 1216 2008-01-17 15:18 PortfolioPolicy.html

9) Nick is trying to protect himself from the War-Between-The-Andys(tm). He wants to block all traffic coming in from their computers, which have the IP numbers 10.1.1.1 and 10.1.1.2. What iptables commands would achieve this?

10) Nick wants this to happen on every boot up. Which file should he change? Where do these lines go?

11) Name a significant difference between Samba and NFS.

12) How do I assign a Samba password for the user megan? What command would I type?

13) In English words, what kind of file names would be matched by the pattern “??*”

14) In Apache, what would the configuration directive “CustomLog /var/log/apache2/access.log combined” do?

15) Suppose I run the command. Circle the executables.
a <b | c | d > e

16) What line might I put into a Samba share definition in /etc/samba/smb.conf to make a share not writable and only readable?

17) Who runs “exportfs”? (Circle all that apply)
The NFS client The NFS server The Samba client The Samba server

18) What command might I run to find out if my CPU is very busy, or if the machine is mostly idle?

19) What is an SUID program?

20) How do I install the package 'hearts'? What command would I type?

THE PROBLEMS (two points each)

Write a shell script such that running it let's me know if there is a user named Micah in /etc/passwd. The output need not be pretty, just tell me the answer.
Make a file available to the world such that anyone who knows the magic password 'doug' can access the file, but no one else can.
List every file on your computer containing more than 10,000,000 bytes.
Make a shell alias such that when I type “showme” it runs “sleep 2; ls -l”
Make me a shell script such that if I'm connected on the network, it says “yes”, otherwise it says “no”.