Updated: 2017-05-31 12:16 EDT
man
and mail
commandssudoers
group and /etc/sudoers
sudo
or using su
adduser
and useradd
are the samehomer
and flanders
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.
You must have your own CentOS virtual machine (with root permissions) running to do this lab. You cannot do the lab on the Course Linux Server because you do not have root permissions on that machine.
23h59 (11:59pm) Friday December 6, 2013 (end of Week 14)
WARNING: Some inattentive students upload Assignment #12 into the Assignment #11 upload area. Don’t make that mistake! Be exact.
This is an overview of how you are expected to complete this assignment. Read all the words before you start working.
Do not print this assignment on paper. On paper, you cannot follow any of the hyperlink URLs that lead you to hints and course notes relevant to answering a question.
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 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.
All references to the “Source Directory” below are to the CLS directory ~idallen/cst8207/13f/assignment12/
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
(seven letters).
This is a Users and Groups assignment. Review course notes Users and Groups.
Use the on-line help (man
command) for the commands listed below for more information.
chown
– (change owner) Change the owner and/or group of an existing inode (needs root
privilege)gpasswd
– administer groups: set group administrator users, set group members, add and remove users from a group, change or remove the group passwordgroupadd
– add a new group to the /etc/group
filegroupdel
– remove a group from the /etc/group
filegroupmod
– modify group name, number, password account information in the /etc/group
filegroups
– list the groups you (or another account) are in (from /etc/group
)id [user]
– display current account, current groups, and SELinux security context informationnewgrp
– start a new shell with the permissions of a different group (similar to su
)su [-] [user]
– (substitute user) Become another user (default root
), with that user’s permissionssudo
– do a command or start a shell (default with root
permissions), configured via visudo
and the file /etc/sudoers
useradd
– add a new user account and home directoryuserdel
– delete an account (and possibly the home directory as well)usermod
– modify account information (and possibly home directory as well)whoami
– (who am I?) Display current account useridyum
– install CentOS (Red Hat) software packageParts of this lab are done as different non-root users. Other parts are done as the root
user. Pay attention to which part is done by which user. After your configure sudo
below, use the sudo
command to run individual commands as root
– don’t use a root
subshell.
If you start a root
subshell (not recommended – use sudo
instead), your prompt will tell you if you are the root
user by changing to include a #
character instead of a $
character. You can also use the commands id
or whoami
to show your current userid.
Some answers require you to record command lines. Do not include the shell prompt with your command lines. Give only the part of the command line that you would type yourself.
Make sure you know the difference between a command line (which is what you type into the shell) and command output (which is what the command displays on your screen). Pay attention to whether the question asks you to record the command line or the command output.
Take a snapshot of your virtual machine before you begin each section of this lab so that you can recover back to the snapshot if needed. You can delete the unused snapshots if everything works well.
You may find it useful to also make a backup copy in a safe place of the /etc/passwd
file and its shadow and the /etc/group
file and its shadow. You can compare the old and new files to know what has changed during this lab, and you can recover these files without reverting everything back to a snapshot.
I recommend that once you have booted your CentOS VM, you connect to it and work using a remote login session (e.g. ssh
or PuTTY
) where copy-and-paste works and where you can have multiple simultaneous connections into the VM. The VMware console is not friendly.
Create your assignment12
directory on the CLS in the usual place.
Run the Checking Program to verify your work so far.
man
and mail
commandsIndexReview Package Management.
man
package.man man
works.mailx
(note the spelling) package.mail -V
prints a version number.Run the Checking Program to verify your work so far.
sudoers
group and /etc/sudoers
IndexOnly authorized accounts can use the sudo
command. We will first create a special sudoers
group. The sudo
command will be configured to permit any account in this group to become the root
user and run any command with full root
privileges.
Login to your CentOS Virtual Machine as the root
user (the only user).
sudo
command, as follows:
man groupadd
manual page, read about the -r
system group option.groupadd
command and an option to create a new system group called sudoers
groupdel
to delete it and start over.sudo
to use the new sudoers
group, as follows:
/etc/sudoers
(for example, /etc/sudoers.bak
)vim
, edit the sudoers
file with the visudo
command.
vim
commands, and you have installed the nano
editor, you can use this instead: # EDITOR=nano visudo
# %wheel ALL=(ALL) ALL
%
character on the example line for the wheel
group%wheel
line, copy and create a new line (not a comment!) that allows anyone in the new sudoers
group to run all commands.
%
character.%wheel
line as the model for your new line.#
at the front of the line you just created. The line must start with %
followed by the new group name (not the wheel
group name)./etc/sudoers
file and quit the editor.Use the diff
command to do a file difference between your backup file /etc/sudoers.bak
and the new /etc/sudoers
file. Only one line should be added – the new %sudoers
line. If not, restore the file (or restore a previous snapshot) and make the changes again.
Run the Checking Program to verify your work so far.
In this section you will create your own system administration account on your CentOS VM. This personal account can be customized for you.
Do not add extensive customization to the
root
account on a system, since such customization may not suit allroot
users of the system and may break automated programs that need to become theroot
user.
Review Users and Groups:
The CentOS useradd
command creates a new account, storing information about the account in the /etc/passwd
file and about the account groups in the /etc/group
file. It also creates a HOME directory for the account and places standard start-up files into it.
The passwd
command sets a password for an account, storing the password in the shadow password file named /etc/shadow
. An account cannot be used until a password has been set. Group passwords (rarely used) are stored in the shadow group file /etc/gshadow
.
References to man pages below will be to CentOS man pages, not CLS man pages. CentOS Linux and Ubuntu Linux are different distributions and they sometimes have different documentation and programs.
Login to your CentOS Virtual Machine as the root
user (the only user).
sudoers
group in the previous section.
fgrep 'sudoers' /etc/group
fgrep '%sudoers' /etc/sudoers
man useradd
manual page:
useradd
command line. (It’s always the last thing on the command line.)--comment
option and following argument used to define your full name. The (quoted) full name argument must immediately follow the option on the command line. See below.-r
system account option and how using it will require you to use the -m
option as well.-m
option. You must use this, too.useradd
man page, add a new system account with the following settings:
/etc/passwd
on the CLS:
/etc/passwd
is called the GECOS field or user’s name or comment field.Firstname
Lastname
- CST8207-13F-4NN
” where Firstname
and Lastname
are your name and 4NN
is your three-digit lab section number.--comment
option.useradd
, verify it:
id abcd0001
where abcd0001
is your new account name.
/ets/skel
.If you didn’t succeed in creating the account and HOME directory correctly, you may restore your snapshot and try again or delete the account using userdel -r
and try again.
man passwd
.Warning: If you do not type the username argument to the password command, you are changing the password of the account that you are signed in with (i.e. the root
account!). Do not change your root
password! Change the password of your new non-root account.
root
shell):
su --login abcd0001
where abcd0001
is your new account name. This will start a login subshell with your account privileges. You should see no error messages. Type some commands.su
subshell, which will return you to your root
login shell.ssh abcd0001@localhost
where abcd0001
is your new account name.
yes
to accept the new host key.root
password by mistake in an earlier step. Fix it and try again.Type who
to see who is logged in. Your new account should be there:
# who
root pts/0 2013-11-16 00:35 (172.16.174.1)
abcd0001 pts/1 2013-11-17 21:23 (localhost)
Exit this login session to return to your root
login.
sudo
for your new sysadmin account, as follows:
sudoers
group that you already created earlier. (Hint: All the command names you might need are listed at the start of this document, and again in Users and Groups.)sudoers
group name in the group file. If not, get help.sudo
, as follows:
exit
) from the root
account.Look at man sudo
, or search the course notes for how to use it. Pay attention to what password sudo
requires! You should be able to do this:
[abcd0001@abcd0001 ~]$ sudo pwd
[sudo] password for abcd0001: # enter the abcd0001 password
/home/abcd0001
[abcd0001@abcd0001 ~]$ sudo -i pwd
/root
[abcd0001@abcd0001 ~]$ sudo -s
[root@abcd0001 abcd0001]# pwd
/home/abcd0001
[root@abcd0001 abcd0001]# exit
[abcd0001@abcd0001 ~]$
-i
option (RTFM) functions similarly to the --login
option of the su
command.-s
), your shell prompt should change from $
to include the #
character that indicates root
privileges. Avoid running root
subshells!sudo
was unsuccessful, check the following:
root
password) when prompted by the sudo
command?sudoers
group?/etc/sudoers
file that allows anyone in the sudoers
group to run all commands? (Check your work.)You must not proceed until you are able to obtain root
shell privileges from your sysadmin (non-root) user account using both su
(with the root
password) and sudo
(with your password). Test these now!
You may optionally remove /etc/sudoers.bak
if everything is working correctly. But maybe you should keep it, just in case.
Run the Checking Program to verify your work so far.
sudo
or using su
IndexNow that you have your own sysadmin account on CentOS, always log in to your Linux machines using your non-root sysadmin account. Many servers actually disable direct login by the root
user; you have to log in as the sysadmin user and then use sudo
or su
to run root
commands.
For most actions that need root
privilege, use the sudo
command to make the account privilege change just for that command. Do not log in as root
or run a root
shell or subshell until you have more experience.
If you do start a full root
subshell using the su
or sudo -s
commands (not recommended), remember to exit
your subshell to return to your previous account. Don’t keep layering multiple subshells inside one another.
root
account!).
Create the same CST8207 assignment12
directory structure in your new sysadmin account HOME directory on CentOS as you have created on the CLS: CST8207-13F/Assignments/assignment12
This CentOS directory is the base directory for all pathnames in this assignment. Store your files and answers here on CentOS.
Pay careful attention to whether you are working on the CLS or CentOS, and which account you are using! Watch the userid and hostname values in your PS1
prompt string! Most answer files in this assignment get stored on CentOS, not on the CLS.
Run the Checking Program to verify your work so far.
root
files in non-root accountsIndexFiles saved anywhere under your sysadmin HOME directory in CentOS should be owned by you, not by root
. (The presence of root
files in non-root accounts is often a sign that your machine has been cracked!)
Do not leave root-owned files in your account. You should change the owner to you of anything you create as root
in your account. To find files not owned by you in your account:
[abcd0001@abcd0001 ~]$ cd
[abcd0001@abcd0001 ~]$ echo "$USER"
abcd0001 # your own userid not abcd0001
[abcd0001@abcd0001 ~]$ find . ! -user "$USER" -ls
[... any non-abcd0001 files are listed here ...]
If you find any files, you should use the chown
command to fix these files to be your own userid and group.
Advanced users can modify the above
find
to send pathnames intosudo
runningxargs
withchown
. See Find and Xargs.
adduser
and useradd
are the sameIndexDo the commands in this section using your own non-root account. As mentioned above, all output files must be owned by you and saved on CentOS in the usual place for this assignment in your account (not in the root
account!).
On CentOS, useradd
and adduser
are the same command with two different names. On some versions of Linux – Debian, Ubuntu, etc. – adduser
is a different command with different options.
On CentOS, try man adduser
and then man useradd
and see that they are exactly the same thing. (If the man
command is not found, you missed a step, above. Go back and install it.)
On the CLS (not CentOS), try the same two man
command lines and see that the two commands are different and have different man
pages on the CLS. (The CLS runs Ubuntu Linux, which is a Debian-based distribution. CentOS is a Red Hat distribution.)
On CentOS, find the absolute pathnames of the two command names adduser
and useradd
. (Note: The which
command won’t find the location of these two commands when run as a non-root user. Which other command locates the pathname and manual pages of a command name? Review the “related commands” in the Search Path notes.) You will need these two absolute pathnames for the next question.
On CentOS, save into output file adduser.txt
the two lines of output from a long ls
listing of the two above absolute pathnames. Your file will be two lines, 20 words, and 130 or 135 characters.
Look at the ls
output lines in adduser.txt
:
useradd
and adduser
are the same command on CentOS?which
command did not work to find the absolute pathnames of either of these commands when run as a non-root user? (Hint: Who can execute the adduser
command?)Run the Checking Program to verify your work so far.
homer
and flanders
IndexYou will need root
privileges (e.g. via sudo
) to run account management commands. Remember not to run root
subshells! Use your sysadmin account and sudo
.
For this section you will require two more ordinary user (non-root, non-system) accounts. We will use two names from The Simpsons television series.
Create an account named homer
(no options needed) and then give it a simple password.
Create an account named flanders
(no options needed) and then give it the same password.
Run the Checking Program to verify your work so far.
Do the commands in this section using your own non-root account. As mentioned above, all output files must be owned by you and saved on CentOS in the usual place for this assignment in your account (not in the root
account!).
Use some id
commands to record the account information for each of the two Simpsons accounts into a simpsons.txt
file. Your file will be two lines, six words, 105 characters; one line for each of the two new Simpsons accounts.
Extract the account information lines for the two new accounts from the system password file and save the information in a simpasswd.txt
file. Your file will be two lines, two words, 84 characters; one line for each Simpsons account. Each password file line will have seven colon-separated fields in it.
Put the long ls
listing of the absolute pathname of each Simpsons account HOME directory (not the contents of the directory – just the directory itself) into a simpath.txt
file, one per line. Your file will be two lines, 18 words, 119 or 125 characters. If you get permission denied, you aren’t using the correct option to ls
to show only the directory, not the contents.
Put the three-digit numeric permissions of either of the above HOME directories in a simperm.txt
file. Your file will be one line, one word, four characters. (Remember why three digits in a file is saved as four characters? Review Text file line end differences in File Transfer.)
Run the Checking Program to verify your work so far.
We will create a /public
directory in the system ROOT directory in which any user can create files. The directory will allow any user to create names in it (or remove names, or rename). Recall that the permissions on a directory are not the same as the permissions on the things named in the directory. Permission to change file names does not grant permission to change file content.
The SB Output File: In the next steps, where you are required to save a command line or its output, do the command and then copy and record the command line or its output as a separate line into an output file simpub.txt
that will be noted as the SB output file below. If you can’t answer a question, leave a blank line in this output file. (The vim
option :set number
may be useful to you as you edit.)
You will need to use a command that lets you start a subshell as another user. Review Users and Groups.
Remember not to run root
subshells! Use your sysadmin account and sudo
.
You need to run commands as different users. You may find it helpful to have separate windows open into your CentOS VM, with subshells in each window running as a different user. Then, you can simply change windows to change users instead of having to exit and enter subshells in the same window. Be lazy!
Use appropriate privileges to create a directory called /public
under the top-level ROOT directory. The exact name is /public
(NOT /root/public
and NOT ./public
and NOT public
!). (Who has permissions to create this directory? Act accordingly.)
/public
directory full access permissions for everybody.
touch
and remove a file in this new /public
directory as any non-root account. Test this (not as root
).Start up a subshell that runs as the flanders
user. (Optionally use a new window for this.)
flanders
user, redirect the current date into a new flanfile
file in the above /public
directory. The file will be 6 words 29 characters.
Record just the owner and group of the flanfile
file as Line 1 in the SB output file (two words only).
Record the current numeric permissions of the flanfile
file as Line 2 in the SB output file (three digits only).
flanfile
file.
flanfile
file as Line 4 in the SB output file (three digits only).Start a subshell that runs as the homer
user. (Optionally use a new window for this.)
homer
user, try to display the contents of the flanfile
. You should get a “Permission denied” error message; homer
does not have permission to read the file content.
homer
user, rename the flanfile
file (still owned by flanders
) to have the new name homfile
(in the same directory as flanfile
).
ls
listing of that new name confirming that the renamed file is still owned by flanders
.
ls
output as Line 5 in the SB output file.homer
user, remove the homfile
name. You will need to answer a question about write-protection, with y
.
flanders
.flanders
) is now gone forever./public
directory is now completely empty.Understand clearly why homer
can rename and then delete a file that he doesn’t own and can’t read. Review Links and Inodes.
Run the Checking Program to verify your work so far.
Remember not to run root
subshells! Use your sysadmin account and sudo
.
You need to run commands as different users. You may find it helpful to have separate windows open into your CentOS VM, with subshells in each window running as a different user. Then, you can simply change windows to change users instead of having to exit and enter subshells in the same window. Be lazy!
/public/homflan
that has the owner and group of homer
and homer
. (Hint: You could create the empty file first, then use chown
to change the owner and group.)
ls
listing of the file and verify that both the owner and group are homer
.As the flanders
user try (and fail) to append the date
to the /public/homflan
file. You should get “Permission denied”.
As the homer
user try (and succeed) to append the date
to the /public/homflan
file. No error message.
Change only the file group and group permissions so that both homer
and flanders
can read and write homflan
but others cannot write the file. Do not change anything about the file except the group and the group permissions!
Hint: homer
, the owner of the file, will read and write the file using the owner permissions. Arrange that the non-owner will be in the group of the file and so group permissions will apply, allowing access. Other users will be neither the owner of the file nor in the group of the file, so “other” permissions will apply to them and they cannot write the file.
Test it as three users. Both homer
and flanders
should be able to append data to the file, while your sysadmin (non-root) account should not be able to append data.
Exit from all the Simpsons user subshells and return to your sysadmin account shell.
Run the Checking Program to verify your work so far.
Take a snapshot of your virtual machine. Review Users and Groups.
Remember not to run root
subshells! Use your sysadmin account and sudo
.
usermod
and groupmod
commands.usermod
command modifies user account attributes, as recorded in the password and group files.groupmod
command modifies group name, number, and password, as recorded in the group file.root
subshells! Use your sysadmin account and sudo
.The WA Output File: In the next steps, where you are required to save a command line or its output, do the command and then copy and record the command line or its output as a separate line into an output file starwars.txt
that will be noted as the WA output file below. If you can’t answer a question, leave a blank line in this output file. (The vim
option :set number
may be useful to you as you edit.)
Create an account named luke
(no options needed).
Give the new luke
account a simple password.
ls
listing on the new HOME directory (just the directory, not the contents) of the new luke
account.
ls
to show only the directory, not the contents.Search for lines containing luke
in the four system accounting files (in the password and password shadow files and in the group and group shadow files – four files in total). When you see four lines of output, put them into a separate luke.txt
file. Your file should contain four lines that contain luke
.
usermod
and groupmod
Indexluke
account to be darth
luke
user should be renamed to darth
.id luke
and confirm that it fails with “No such user”id darth
and confirm that darth
exists, but the account is still in the group named luke
.ls -ld
on the HOME directory for this account (which hasn’t changed) and note that the owner has changed, but not the group (it’s still luke
).luke
group to be darth
luke
group should be renamed to darth
.id darth
and confirm that the account is now in the group named darth
.ls -ld
on the HOME directory for this account (which still hasn’t changed) and note that both the owner and group have been changed.darth
account still uses an unchanged home directory of/home/luke
. Use a command to change and move (in one command line) this old home directory from its current luke
name to the new name sith
-d
and -m
strictly according to the man page.ls -ld
on the new changed and moved HOME directory for this account and confirm that both the owner and group are still darth
.luke
does not appear anywhere in those four files.darth
account using su
. There should be no errors.darth
subshell and return to your sysadmin account shell.chsh
IndexUse the appropriate option to the chsh
command to print the list of possible shells (four lines).
Change the shell for darth
to be the one that prevents logins. (Choose the shell pathname that allows “no logins”.)
Try to start a login subshell in the darth
account using su
. You will be rejected with “This account is currently not available.”
Run the Checking Program to verify your work so far.
usermod
and groupmod
IndexCreate an account named obiwan
(no options needed).
Give the new obiwan
account a simple password.
Search for lines containing obiwan
in the four system accounting files. When you see four lines of output, put them into an obiwan.txt
file. Your file should contain four lines that contain obiwan
.
obiwan
account and group to be the new name yoda
with home directory master
(in the usual place for home directories).
obiwan
is completely gone from all system accounting files.master
home directory is in the right place and has the correct owner and group.yoda
account without errors. (And exit that subshell!)Run the Checking Program to verify your work so far.
This section uses some commands you have not used before.
Every command you need to use is mentioned in the opening page of this assignment document and is described in the lecture notes on Users and Groups. Become familiar with this list of commands before you continue, so that you know what command name to choose below. Every command also has a man page.
You do not need to text-edit any files in this section. All the commands you need are noted at the top of this document (and again in the Users and Groups course notes). RTFM!
The four-person band Megadeth (note the unusual spelling of Megadeth) uses the following work approach and has the following Requirements:
Song files can be created by one band member who is the single group administrator account. Only this one group administrator account can create, delete, modify and write song files.
Files must only be readable (not writable or removable) by the other three non-administrator group (band) members. These three ordinary band members must only be able to read the song files, not change or remove or rename them.
Anybody who is not a band member is not allowed to view song files. You must prevent all public access of any kind to the song files.
Follow the directions below to create accounts and directories that implement the above Requirements. Some of the work will need to be done as the root
super-user. (Only the root
user can create new accounts.) Most group maintenance work can be done as the band member who is assigned to be the group administrator.
The four Megadeth band members are (get the name and account spellings correct! Case matters):
mustaid
ellefsd
broderc
drovers
Remember not to run root
subshells! Use your sysadmin account and sudo
.
Take a VM snapshot before you begin this section, so you can return here if you make many mistakes. Keep a separate record of the exact commands you use in this section, for study purposes.
--comment
option to include each band member’s full name in each account you create.
usermod
command afterward.Give all four accounts some simple passwords.
megadeth
(spelled all lower case) to the system accounting files.
megadeth
group a system group. Keep it ordinary.megadeth
group is now in the system group file and has a numeric GID of 500 or greater. If not, delete it and try again.megadeth
group.
megadeth
group in the group shadow file lists Chris’ account userid in the third field. If not, delete it and try again.megadeth
group administrator. Using his account, use a command four times to add each of the four band members to the megadeth
group, one-by-one.
megadeth
group with all four band members listed beside it.Create a new song directory named /home/music
(lower-case).
music
directory, with permissions that implement the Requirements given above. Set ownership and permissions for the music
directory to implement the given Requirements:
music
?
music
?
music
?
You need to verify that the requirements have been met using a Test Plan. Here it is:
date
into a new file named test
in the music
directory. It should be possible without any errors.test
file, but can not change it, rename it, or remove it.music
directory cannot be listed or entered by any user who is not a band member.music
in the home directory that links up to /home/music
so that each band member can then use the soft link to access the /home/music
directory instead typing the entire pathname.That is all the tasks you need to do.
Check your work a final time using the Checking Program and save the output as described below. Submit your mark following the directions below.
Summary: Do some tasks, then run the Fetch and checking program to verify your work as you go. You can run the Fetch and checking program as often as you want. When you have the best mark, upload the marks file to Blackboard.
The checking program resides on the Course Linux Server, but your work is on your CentOS Virtual Machine. There is a new Fetch program that you must download and use on your CentOS Virtual Machine to copy information from your CentOS 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 CentOS Virtual Machine, you need to run the Fetch program again on CentOS 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 below on your CentOS VM when you make changes on your CentOS Virtual Machine.
Do all the following steps on your CentOS Virtual Machine. Read through the whole list before you start typing anything. An example of what to type is given below the descriptions that follow.
Log in to CentOS using your system administrator (non-root) account.
Change to your existing CentOS assignment12
directory containing all your answer files for this assignment.
curl
to get a copy of the Fetch program from the given URL into a file named do.sh
.
do.sh
in your assignment12
directory.#!/bin/sh
and contain a few shell comments and commands, including another curl
command.sudo
to run the do.sh
script you just downloaded to CentOS, with the USER
environment variable set to your own College/Blackboard/CLS account userid (do not use abcd0001
).
sudo
to run the script.This Fetch program will connect from CentOS to the CLS using your account name. It will copy files from CentOS to your assignment12
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 (use your userid, not abcd0001
): - You must use sudo
to run the script:
CentOS$ hostname
abcd0001
CentOS$ pwd
/home/abcd0001/CST8207-13F/Assignments/assignment12
CentOS$ echo "$USER"
abcd0001
CentOS$ curl -A mozilla http://teaching.idallen.com/cst8207/13f/notes/data/assignment12do.sh >do.sh
[... various download statistics print here ...]
CentOS$ sudo USER=$USER sh do.sh
---------------------------------------------------------------------------
abcd0001: FETCH version 2. 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 assignment12fetch_server.sh version 4 run by abcd0001.
Please wait; collecting info from abcd0001 Virtual Machine
---------------------------------------------------------------------------
VM files collected into CST8207-13F/Assignments/assignment12/abcd0001.tar.bz on CLS.
Now running checking program for abcd0001 on CLS:
[... checking program output appears here ...]
curl
line once per assignment, to get a copy of the do.sh
script.do.sh
script, you can use sudo
to run the do.sh
script over and over to check your work as you make updates.assignment12
on the CLS..bashrc
file or world-writable files on the CLS). These errors are on the CLS, not on your CentOS machine.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 one last time on the Course Linux Server (not on CentOS):
There is a Checking Program named assignment12check
in the Source Directory on the CLS. Create a Symbolic Link to this program named check
under your new assignment12
directory on the CLS so that you can easily run the program to check your work and assign your work a mark on the CLS. Note: You can create a symbolic link to this executable program but you do not have permission to read or copy the program file.
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 fetched CentOS 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.)
Remember: The checking program does not fetch new files to the CLS from your CentOS VM. You must run the Fetch program on your CentOS VM to update the fetched files on the CLS so that the checking program can mark them on the CLS.
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.
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 assignment12.txt
under your assignment12
directory on the CLS. Use the exact name assignment12.txt
in your assignment12
directory. Case (upper/lower case letters) matters. Be absolutely accurate, as if your marks depended on it. Do not edit the file. Make sure the file actually contains the output of the checking program!
Transfer the above assignment12.txt
file from the CLS to your local computer and verify that the file still contains all the output from the checking program. 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.
Submit the assignment12.txt
file under the correct Assignment area on Blackboard (with the exact name) before the due date. Upload the file via the assignment12 “Upload Assignment” facility in Blackboard: click on the underlined assignment12 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.)
Your instructor may also mark the assignment12
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!
Your instructor may also mark the files on your CentOS VM after the due date. Leave everything there on your CentOS VM. Do not delete any assignment work from the CentOS VM 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!