HW 3 - CS 480 M01 Fall 2021
CS 480 M01 Fall 2022 - Homework Assignment #3
Due: 11:59 PM Sep 24 2022
Assignment:
Points: 80 points total
- 20 points : Read all man pages listed below (from sections 1 , 5, or 8; try the commands, look into the files, ... while reading) and in a short paragraph (3-5 lines per man page in your words - do not just copy parts of the man page) describe what is each of them for. Also, for the commands choose an extra option (not the help nor version options) and in few more lines describe situations in which you would use the selected option. In case of the commands with long man pages and many options choose at least two extra options and describe situations in which you would use them.
- chmod
- chown
- crontab ( command )
- getfacl
- ln
- login.defs
- newgrp
- passwd (command)
- passwd (file)
- shadow (file)
- setfacl
- umask
- useradd
- userdel
- usermod
- vipw
Each exercise below is to be implemented on your cs480 virtual host.
Every question asked needs to be answered in your assignment report.
For every exercise below describe in sufficient detail the whole process and explain what you did to accomplish the task.
Make sure that you list and discuss all important steps made, commands used together with their options, and problems encountered.
You cannot use yast to accomplish any of the tasks below.
- 5 points :
Describe how is a user's default(=primary) group determined.
On your cs480 virtual computer
create new group "hwgrp480" and make it the default group for user bob.
- 6 points
Local user jim has been abusing his crontab privileges by running expensive tasks at frequent intervals. After asking him to stop several times, you are forced to revoke his privileges. List the steps needed to delete his current crontab and make sure he can't add a new one. Implement your solution on your cs480 virtual machine, and test it to make sure that it works.
- 8 points
Write a simple Perl script that processes the output of ps aux
to determine the total VSZ and RSS of the processes running on the system.
Write and execute the script on your cs480 virtual host and submit a transcript of the session showing your program computing the totals correctly.
- 8 points
On your CS480 VM
create user "John Class" without using yast, useradd, groupadd, or any other high level program
(edit related files, create directories, copy files, change permissions and ownerships, ... You can use the
passwd
command to set user's password)
- login name: jclass
- home directory: /home/jclass
- everything else : your choice ... - discuss your choices in your report : what did you do, how and why
- log into the system as jclass and make sure the user is created correctly and can use the system without problems
- in your report list all the steps needed to add the user above
- 8 points :
There was new directory created (/hw3playground/) on your cs480 VM:
# ls -al /hw3playground/
total 0
drwxr-xr-x 1 root root 12 Sep 20 12:55 .
drwxr-xr-x 1 root root 172 Sep 20 12:58 ..
drwx------ 1 root root 0 Sep 20 12:55 bob
drwxr-xr-x 1 root root 0 Sep 20 12:55 tmp
Your task is to change permissions so that
-
Every user can write into (create new files in) /hw3playground/tmp but cannot delete files that belong to other users.
-
Apart from root only bob can create files in /hw3playground/bob and only user joe and group ntadmin can list and access files there.
At the same time root:root must remain the owner of all of these 3 directories (/hw3playground, /hw3playground/bob, and /hw3playground/tmp).
- 5 points :
Create new directory /cs480home and modify your system's settings to make it the default directory
where new user's home directories will be created when using command useradd (unless the -b or -d options are specified).
Test it by creating new user hw4user (created by command useradd). Make sure that the home directory is created correctly.
NOTE: Your solutions to all of the exercises above must be implemented, tested, and execute correctly on your cs480 virtual machine. Among your attachments (as part of the tar.bz2 file) submit also transcript files showing the correct execution of the commands / scripts as you executed them on your cs480 virtual machine. You can use the script command to record the session and submit the resulting files (3.5_transcript.txt, ...) with your homework assignment as part of your bz2 file submited into your directory under /home/CS480 (wthin the cs.nmsu.edu domain).
Submitted files, overall quality, length, and feedback:
- 5 pts : Submit all relevant files you modified during the lab (into the /home/CS480/yourcsloginname directory as part of the tar.bz2 file) . Exactly two files need to be submitted: One file being your report in PDF is to be submitted on the Blackboard. The other file is the tar.bz2 file containing everything else and it gets submitted into /home/CS480 (Pack the files together using tar and bzip2, and copy them using scp from your computer into your cs account )
- 10 pts - Submit your report as a PDF document through learn.nmsu.edu and all supporting documents, programs, and execution transcripts as part of the tar.bz2 file in your directory under /home/CS480. The report has to contain answers to all questions above, and for the practical problems on your computer describe in detail choices you made, difficulties you encountered, and how did you deal with them.
- 5 pts - Feedback:In the last paragraph of your report estimate how much time you spent on this assignment. Describe what was hard, easy, interesting, boring or confusing.
Please remember the submission requirements:
Two files need to be submitted for every assignment :
- The first file is your typed report .
It has to be submitted through http://learn.nmsu.edu as one file / document and it has to be in the PDF format.
No other format will be accepted. The name of the file has to contain your name and assignment/lab number separated by "_" (If your name is John Smith then the name of the document submitted for this assignment needs to be John_Smith_HW03.pdf).
- The second file to be submitted into your directory under /home/CS480 directory has to be a tar.bz2 file that contains all other files related to the assignment.
It will contain all relevant files that you modified for the assignment. Everything that was done to finish the lab, modify your system, write, run and verify submitted programs and scripts used needs to be included in the submitted tar.bz2 file. That includes all your system configuration files modified for the lab/assignment as well as programs and scripts written (including complete source code, supporting shell scripts, test data input files, ...). The name of the tar.bz2 file has to contain your CS login name and the lab number separated by "_" (if your cs login name was jsmith then the file's name for this assignment will be jsmith_Lab03.tar.bz2 ). The files submitted as part of the tar.bz2 file have to be exact copies as found on your cs480 lab system.
If you want to correct or add something to already submitted assignment than you need to do so before the deadline and resubmit the whole report again and also resubmit your new tar.bz2 file .
Please remember that late submissions are penalized 20% / day and NO submissions that are late 3 or more days will be accepted. You can be late at most 2 days to receive any points.