Felitaur Enterprises Linux System Administration | Felitaur Enterprises Homepage

Exam 2 for CIS126DL

Instructor: Phil Waclawski
Spring 2016

Instructions: As this is an HTML file which is kind of in plain text, you can save it to disk and type to it if you wish, or you can type the answers on a seperate file, but no handwritten answers please. :) (You can just highlight the questions and paste them to vim. Questions are worth about 2pts each, with some exceptions.

YOU MUST TYPE YOUR ANSWERS, UNTYPED EXAMS WILL NOT BE GRADED!!
Also, you must UPLOAD your file to canvas in the dropbox!

NOTE: You must also put each answer below the question as well. (and keep the number the same)
Either .doc, .odt, .docx

You can use any resource you want EXCEPT other people, animals, aliens etc. However, you MUST document that source (if it is the course book just put (CB) after it ;) So if it is a web page, give me the URL someplace, etc.

Some of this may be in the book, some of it you may have to search for a bit, but if you want to become a sys admin you had best learn how to search the web.

Additionally, when I ask for "How would I make it so I can view a huge directory with ls without it scrolling off the screen" a simple
ls -l | more
is all I need for an answer. Keep these short. Even some of the first questions should be a couple of sentences at most. I know this test will be some work (I figure it will take you about 3-4 hours to finish, not counting boot up times etc) but I don't want it becoming a nightmare. Good hunting.


MAKE SURE TO COPY THE QUESTIONS INTO YOUR EXAM, put the answers below each question and keep the question numbers the same!

DO NOT JUST COPY THE ANSWERS FROM WIKIPEDIA OR THE WEB!. Put things into YOUR OWN WORDS, and do YOUR OWN WORK. Otherwise 0pts

  1. (10pts)First, a bit of history.
    1. When was UNIX invented?
    2. Who were the creators(both the company and a few names)?
    3. WHY was it first made?
    4. How did it get spread to so many universities?
    5. Who created Linux and how old is it?
  2. (3pts each) Linux Distributions (Note: will need to do searches for this)
    1. Name 3 Linux distributions that focus on desktop users
    2. Name 3 Linux Distributions that are focused on servers
    3. Name at least two "live CD" versions of Linux, and name a live distribution used for a Tivo Like Program
  3. (9 pts, 3 each)You want to install some flavor of Linux on a machine. You think you have all your information on your hardware, but now you are wondering what is the best way to partition your drives.
    1. For partitioning, what is a primary partition?
    2. What is an extended/logical partition?
    3. How many can you have of each in linux?
  4. (12 points, 3 each)Questions about mounted/mounting file systems.
    1. Type the command you would use to mount the cdrom drive manually on /media/cdrom (including the filesystem type).
    2. What command would you use to get a list of the presently mounted file systems?
    3. In what file (include FULL path to it) is the information about file systems that are mounted during boot up kept?
    4. How would you format a drive with the file system Linux (ext4) (and some other UNIX) systems use?
  5. (10pts)The /etc directory is fairly important due to the number of configuration files held within it. So, answer the following questions, and include the subdirectory(s) if any:
    1. What file(s) are the user accounts and encrypted passwords kept?
    2. What file(s) have the group information and group passwords?
    3. What file(s)/directory(s) have the printer configuration in them?
    4. What file(s) have the standard port number for services?
    5. What file(s) list the DNS name servers for your network?
  6. (8pts) Run Levels and Services
    1. What are the runlevels in Linux? How do you change the runlevel to 3 (multiuser but no graphics) on a system D system?
    2. How would you restart a service like sshd? Show the command (system D)
    3. On a System D system, how do you get a list of what services are presently running?
    4. On the Old systems (prior to Redhat/CentOS 7) what command did they provide to alter run levels at the command line?
  7. (20 pts, 5 each) To review a few basics from the intro part of the course, we'll ask a few telling questions.
    1. You have a big file called happydays, and want to find all the lines that do NOT have the word "shozbot" in it, and you want to sort them alphabetically, and save that in a file called "squiggy". How would you do that in one line of commands?
    2. You want to find all the processes that your user (the username you created) is running at the time and write those to a file called myps. Again, what one line of commands would you type?
    3. A user lets you know that someone is probably running a program called "we know you don't want this but we hope you're still stupid enough to fall for our scam", or spammersuck for short. :) This is a program that is apparently using YOUR email server to send 1 million get rich quick email spams. How would you find if "spammersuck" was running on your system, and how would you get rid of it?
    4. You note that someone has set the permissions on a file wrong.
      You want the permissions to look like -rwxr-x--- for the file "selfdestruct"
      And you want the group set to "saints" and the owner set to "root". This will take two or three seperate commands. Show all your work. :)
  8. (8 pts)You also need to know how to edit text files, (everything seems to be text files in UNIX/Linux as someone pointed out to me :) So...
    1. Using vim, how would you open a file called "genome.conf", how would you find the word "deoxyribonucleic" in that file, and how would you save the file, then how would you quit? (again, you can just give the commands).
    2. How would you search and replace all examples of AZ with Arizona for all lines in the file arizonachat.txt ?
  9. (9 pts, 3 each)Backing up files
    1. You want to back up and zip the home directory of a user and save it in a file called "cya.tar.gz". What command would you type (the user name is troublemaker)
    2. How would you back up the directories /home/pwaclaws /etc and /usr/local/lib to a file called important.tar ?
    3. rsync is a very handy utility. Explain what it does, and show me the command to sync a directory ~/mystuff with ~/Desktop/backupofmystuff. Why is it more efficient than copy?
  10. (5pts) You want members of the group "aloha" to have access to the shutdown, ifup and ifdown commands, as well as the ability to restart the httpd daemon (but only restart). Give the steps to set this up via sudo. (Note: For CentOS 7 you need to use systemctl now ;)
Felitaur Enterprises Linux System Administration | Felitaur Enterprises Homepage