% CST8207 Assignment 11 - user and group management (Megadeth Project) % Ian! D. Allen - idallen@idallen.ca - www.idallen.com % Winter 2013 - January to April 2013 - Updated 2017-05-31 12:13 EDT - [Course Home Page] - [Course Outline] - [All Weeks] - [Plain Text] Due Date and Deliverables ========================= > **Do not print this assignment on paper!** > > - On paper, you will miss updates, corrections, and hints added to the > online version. > - On paper, you cannot follow any of the [hyperlink URLs] that lead you > to hints and course notes relevant to answering a question. > - On paper, scrolling text boxes will be cut off and not print properly. - **Due Date**: `11h00 (11am) Monday April 8, 2013 (start of Week 13)` - NOTE: Assignments 12 and 13 are also due before the course ends. - Late assignments or wrong file names may not be marked. Be accurate. - **Available online**: - Version 1: 00:10 Tuesday March 26, 2013 - Version 2: 02:45 Wednesday March 27, 2013 (added GRUB edit) - Version 3: 12:10 Tuesday April 2, 2013 (fixed wc count of grub.conf) - **Prerequisites**: - The current [Class Notes][All Weeks]. - Linux Fedora 12 installed in a virtual machine via [Fedora 12 Virtual Machine] - An ability to **READ ALL THE WORDS** to work effectively. - **Deliverables**: 1. Completed [Fedora 12 Virtual Machine] installation. - This assignment requires you to complete the install. 2. Modifications to your [Fedora 12 Virtual Machine] as given in this assignment. - **Do not delete any assignment work from your [Fedora 12 Virtual Machine] until after the term is over!** 3. Directory structure and files created and left for marking on the [Course Linux Server] (**CLS**). - **Do not delete any assignment work from the CLS until after the term is over!** 4. One text file uploaded to Blackboard according to the steps in the [Checking Program] section below. **WARNING:** Some inattentive students upload Assignment #11 into the Assignment #10 upload area. Don't make that mistake! Be exact. Purpose of this Assignment ========================== This assignment is based on your weekly [Class Notes][All Weeks]. 1. Practice managing [Users and Groups] in your own virtual machine. Remember to **READ ALL THE WORDS** to work effectively and not waste time. Introduction and Overview ========================= This is an overview of how you are expected to complete this assignment. Read all the words before you start working. 1. Complete the [Tasks] listed below. 2. Verify your own work before running the [Checking Program]. 3. Run the [Checking Program] to help you find errors. 4. Submit the output of the [Checking Program] to Blackboard before the due date. 5. **READ ALL THE WORDS** to work effectively and not waste time. > Since I also do manual marking of student assignments, your final mark may > not be the same as the mark submitted using the current version of the > [Checking Program]. I do not guarantee that any version of the [Checking > Program] will find all the errors in your work. Complete your assignments > according to the specifications, not according to the incomplete set of the > mistakes detected by the [Checking Program]. When you are finished the tasks, leave the files and directories in place as part of your deliverables. **Do not delete any assignment work until after the term is over!** Assignments may be re-marked at any time; you must have your term work available right until term end. Searching the course notes -------------------------- All the course notes are always available on the Internet here: [CST8207 GNU/Linux Operating Systems I][All Weeks]. All the current and previous terms notes files are also stored on the CLS. You can learn about how to read and search these notes files using the command line on the CLS under the heading *Copies of the CST8207 course notes* near the bottom of the page [Course Linux Server]. The Source Directory -------------------- All references to the "Source Directory" below are to the CLS directory `~idallen/cst8207/13w/assignment11/` and that name starts with a *tilde* character "`~`" followed by a userid with no intervening slash. The leading tilde indicates to the shell that the pathname starts with the HOME directory of the account `idallen`. Tasks ===== - Do the following tasks in order, from top to bottom. - Pay attention as to which tasks must be done in your own [Fedora 12 Virtual Machine] and which must be done in your account on the [Course Linux Server]. - **READ ALL THE WORDS!** and do not skip steps. Set Up ------ 1. On the [Course Linux Server], make the directory `CST8207-13W/Assignments/assignment11`, in which some information will be stored related to this assignment. 2. Create the `check` symbolic link needed to run the [Checking Program], as described in the section [Checking Program] below. 3. Complete your [Fedora 12 Virtual Machine] Installation. 4. Before you begin this assignment, create a snapshot of your [Fedora 12 Virtual Machine]. - Enter a comment explaining where and when you took this snapshot. - You can restore back to this snapshot if anything goes wrong. Worksheet and Assignment 11 --------------------------- 1. Review course notes [Users and Groups]. 2. Complete [Worksheet #11 ODT] in your [Fedora 12 Virtual Machine]. - Note the complete list of required commands on Page One. - You can run the [Checking Program] to check your work as you go. Grub menu and time-out ---------------------- Your Virtual Machine appears to boot directly into Fedora 12, but there is a hidden boot-loader menu available for a fraction of a second just before the lines start drawing themselves across the bottom of the Fedora 12 boot screen. We need to make this menu visible and available for a longer time; you need access to this menu to boot your Virtual Machine in single-user mode. 1. The file `/etc/grub.conf` in Fedora 12 is a symbolic link. Dereference this link (in Fedora 12) and find its absolute pathname. Enter that absolute pathname into file `grubpath.txt` under your `assignment11` directory on the CLS (not on Fedora 12). You should see these numbers from `wc`: `1 1 21 grubpath.txt` 2. Use `wc` on the Fedora 12 `/etc/grub.conf`. You should see: `17 76 NNN /etc/grub.conf`, where *NNN* is the number of characters (approximately 740). Append this line of output as a second line in your CLS `grubpath.txt` file. The exact number of characters may differ slightly. 3. Edit `/etc/grub.conf` on Fedora 12 and make only these two changes: a. Change the `timeout=0` line to say `timeout=30` b. Comment-out the `hiddenmenu` line by inserting a `#` character at the start of the line, e.g. `#hiddenmenu` 4. Save the `/etc/grub.conf` file and exit your editor. 5. Use `wc` on the Fedora 12 `/etc/grub.conf` again. You should see: `17 76 NNN /etc/grub.conf` where *NNN* is now exactly two characters larger than the previous version of *NNN* saved above (approximately 742 characters). Append this line of output as a third line in your CLS `grubpath.txt` file. The exact number of characters may differ slightly. You will now see a `GNU GRUB Version 0.97` boot-time menu when you reboot. The menu will time-out after 30 seconds and Fedora 12 will boot, or you can use the `Enter` key to boot immediately without waiting for the time-out. When you are done ----------------- When you are finished, run the [Checking Program] to create an overall mark. Submit the output to Blackboard in the correct location. > Since I also do manual marking of student assignments, your final mark may > not be the same as the mark submitted using the current version of the > [Checking Program]. I do not guarantee that any version of the [Checking > Program] will find all the errors in your work. Complete your assignments > according to the specifications, not according to the incomplete set of the > mistakes detected by the [Checking Program]. 1. Optional: Keeping your base [Fedora 12 Virtual Machine] snapshot, remove any intermediate snapshots you no longer require, to free up disk space. - Be careful not to remove your current work! Checking, Marking, and Submitting your Work =========================================== The checking program resides on the [Course Linux Server], but your work is on your [Fedora 12 Virtual Machine]. There is a new **Fetch** program that you must download and use on your Fedora 12 machine to copy information from your Fedora 12 Virtual Machine to your account on the CLS so that the checking program can check it on the CLS. Once the **Fetch** program has fetched these files from your Virtual Machine to the CLS, you can run the checking program on the CLS to check what is saved in the files. When you make changes on your Fedora 12 Virtual Machine, you need to run the **Fetch** program again to update the saved files on the CLS. Simply running the checking program on the CLS will *not* update the saved files on the CLS. You must run the **Fetch** program when you make changes on your Fedora 12 Virtual Machine. Part I - Fetch and Check ------------------------ Do all the following steps on your [Fedora 12 Virtual Machine]. Read through the whole list before you start typing anything. 1. Log in to Fedora 12 as your non-`root` account (same userid as Blackboard). 2. Create a directory in your account named `CST8207-13W/Assignments/assignment11` (exactly the same directory hierarchy as you already have on the CLS). 3. Change to your above `assignment11` directory. 4. As shown below, use `wget` to get a copy of the **Fetch** program from this URL into a file named `do.sh`: Fedora$ wget -O do.sh http://teaching.idallen.com/cst8207/13w/notes/data/assignment11wget.sh `do.sh' saved [545/545] # size may differ slightly Make sure you have a file named `do.sh` in your directory. You only need to download this once. 5. Become the `root` user on Fedora 12. 6. As shown below, use `sh` to run the `do.sh` script you just downloaded to Fedora 12 with the `USER` environment variable set to your own CLS account userid. (Do not use *abcd0001*.) Fedora# USER=abcd0001 sh do.sh # use your *own* userid *not* abcd0001 7. This **Fetch** program will connect from Fedora 12 to the CLS using your account name. It will copy files from Fedora 12 to your `assignment11` directory on the CLS. It will then run the checking program on the CLS to check your work. You will need to answer one question about your IP address, and then wait and type in your CLS password. It will look something like this: Fedora$ whoami abcd0001 Fedora$ hostname abcd0001 Fedora$ pwd /home/abcd0001/CST8207-13W/Assignments/assignment11 Fedora$ wget -O do.sh http://teaching.idallen.com/cst8207/13w/notes/data/assignment11wget.sh `do.sh' saved [545/545] # size may differ slightly Fedora$ su Password: Fedora# USER=abcd0001 sh do.sh # use your *own* userid *not* abcd0001 --------------------------------------------------------------------------- abcd0001: FETCH version 1. Connecting to CLS as USER='abcd0001' using ssh --------------------------------------------------------------------------- abcd0001: Use local Algonquin IP cst8207-alg.idallen.ca [y/N]? n abcd0001: Please wait; using ssh to connect to user 'abcd0001' on cst8207.idallen.ca ... *** COURSE LINUX SERVER *** abcd0001@cst8207.idallen.ca's password: # enter your CLS password --------------------------------------------------------------------------- idallen-ubuntu assignment11fetch_server.sh version 0 run by abcd0001. Please wait; collecting info from abcd0001 Virtual Machine --------------------------------------------------------------------------- VM files collected into CST8207-13W/Assignments/assignment11/abcd0001.tar.bz on CLS. Now running check program for abcd0001 on CLS: ---------------------------------------------------------------------------- idallen-ubuntu check: CST8207-13W/Assignments/assignment11 check program version 00 *** Checking account for abcd0001 on idallen-ubuntu *** [... checking program output appears here ...] ### Notes on the Fetch program - This **Fetch** program updates your saved files on the CLS and then runs the checking program on the CLS. If you only run the checking program on the CLS, it won't update the files from your Fedora 12 VM and will check the exiting files saved under `assignment11` on the CLS. - The checking program is running on the CLS, not on your Fedora 12 VM. At the start, the checking program will issue messages relevant to your account on the CLS (e.g. errors in your CLS `.bashrc` file or world-writable files on the CLS). These errors are on the CLS, not on your Fedora 12 machine. Part II - Check and Submit -------------------------- When you are done with your assignment, you need to run the checking program one last time on the CLS and submit the output file, as follows: Do all this on the [Course Linux Server]: 1. There is a [Checking Program] named `assignment11check` in the [Source Directory] on the CLS. Create a [Symbolic Link] to this program named `check` under your new `assignment11` directory so that you can easily run the program to check your work and assign your work a mark. Note: You can create a symbolic link to this executable program but you do not have permission to read or copy the program file. 2. Execute the above "check" program on the CLS using its symbolic link. (Review the [Search Path] notes if you forget how to run a program by pathname from the command line.) This program will check your work, assign you a mark, and display the output on your screen. (You may want to paginate the long output so you can read all of it.) You may run the "check" program as many times as you wish, to correct mistakes and get the best mark. Some tasks sections require you to finish the whole section before running the checking program at the end; you may not always be able to run the checking program successfully after every single task step. 3. When you are done with checking this assignment, and you like what you see on your screen, redirect the output of the [Checking Program] into the text file `assignment11.txt` under your `assignment11` directory on the CLS. Use the *exact* name `assignment11.txt` in your `assignment11` directory. You only get *one* chance to get the name correct. Case (upper/lower case letters) matters. Be absolutely accurate, as if your marks depended on it. Do not edit the file. 4. Transfer the above `assignment11.txt` file from the CLS to your local computer and verify its contents. Do not edit this file! No empty files, please! Edited or damaged files will not be marked. You may want to refer to your [File Transfer] notes. 5. Submit the `assignment11.txt` file under the correct Assignment area on Blackboard (with the exact name) before the due date. Upload the file via the **assignment11** "Upload Assignment" facility in Blackboard: click on the underlined **assignment11** link in Blackboard. Use "**Attach File**" and "**Submit**" to upload your plain text file. No word-processor documents. Do not send email. Use only "Attach File". Do not enter any text into the **Submission** or **Comments** boxes on Blackboard; I do not read them. Use only the "**Attach File**" section followed by the **Submit** button. (If you want to send me comments about your assignment, use email.) 6. Your instructor may also mark the `assignment11` directory in your CLS account after the due date. Leave everything there on the CLS. **Do not delete any assignment work from the CLS until after the term is over!** Use the *exact* file name given above. Upload only one single file of plain text, not HTML, not MSWord. No fonts, no word-processing. Plain text only. Did I mention that the format is plain text (suitable for VIM/Nano/Pico/Gedit or Notepad)? **NO EMAIL, WORD PROCESSOR, PDF, RTF, or HTML DOCUMENTS ACCEPTED.** No marks are awarded for submitting under the wrong assignment number or for using the wrong file name. Use the exact name given above. WARNING: Some inattentive students don't read all these words. Don't make that mistake! Be exact. **READ ALL THE WORDS. OH PLEASE, PLEASE, PLEASE READ ALL THE WORDS!** -- | Ian! D. Allen - idallen@idallen.ca - Ottawa, Ontario, Canada | Home Page: http://idallen.com/ Contact Improv: http://contactimprov.ca/ | College professor (Free/Libre GNU+Linux) at: http://teaching.idallen.com/ | Defend digital freedom: http://eff.org/ and have fun: http://fools.ca/ [Plain Text] - plain text version of this page in [Pandoc Markdown] format [Course Home Page]: .. [Course Outline]: course_outline.pdf [All Weeks]: indexcgi.cgi [Plain Text]: assignment11.txt [hyperlink URLs]: indexcgi.cgi#Important_Notes__alphabetical_order_ [Fedora 12 Virtual Machine]: worksheet07.odt [Course Linux Server]: 010_course_linux_server.html [Checking Program]: #checking-marking-and-submitting-your-work [Users and Groups]: 700_users_and_groups.html [Tasks]: #tasks [Worksheet #11 ODT]: worksheet11.odt [Source Directory]: #the-source-directory [Symbolic Link]: 460_symbolic_links.html [Search Path]: 400_search_path.html [File Transfer]: 015_file_transfer.html [Pandoc Markdown]: http://johnmacfarlane.net/pandoc/