Assignment D
General instructions for all assignments
Provide an answer for each item in each session.
Number each answer with the same number as the corresponding item in the session assignment.
When the answer to the item is a Unix command, show the command and the system's response.
When the system prints more than 5 lines, abbreviate the response to 5 lines
(unless more lines are specifically requested), showing the most important parts.
Use vi to create a file for each session, for example,
create a file named sessionD1
Special instructions for assignment D
Working on assignment, you need to pair up with another student to do some of the lab work.
They will need to read your files. You will need to read their files.
Session D1
- Log into the system.
- Check which group or groups you belong to.
- Use the umask command to allow default permissions to be 700 for newly created directories.
- Create a directory named directoryD in your home directory.
- While still in your home directory, check the permissions of your directoryD directory. Are they 700?
If the permissions of the directoryD directory are not 700, delete it and start over and try again.
- While still in your home directory, create a directory under the directoryD directory and
name it directoryD1
- While still in your home directory, check the permissions of your directoryD1 directory. Are they 700?
- Change to the directoryD1 directory.
- Create a file named commandsD1 in this directory. It should contain five lines of text,
each containing the name and a very
short description of the commands: umask chmod groups cd mv
- Print this file. (Remember that print in UNIX means print to the screen.)
- Check the permissions of the commandsD1 file. Are they 700 or 600? Why? Explain the difference
between the initial permissions set for files and for directories.
- Are the users in your group allowed any access to this file? Are other users
(outside of your group) allowed any access to this file?
- In the remainder of this session, work with another student.
You will try to read their commandsD1 file; they will try to read your commandsD1 file.
- These attempts should fail. One of the reasons for the failures is
because group members do not have read permission for the commandsD1 files.
- While still in directoryD1, change the file permissions to allow users in your group
to read this file, but do not change the permissions for others.
- You and your partner should try again. It should still fail. Why?
- Is there a need to change the permissions of any directories?
If yes, make the necessary change(s). (This response may total a maximum of 10 lines.)
- While still in directoryD1, use ls to verify the work done in the previous item.
- Your partner should copy this file into their directoryD1 with the new name of partner. Was the
copy successful? If not, find the reason and take the appropriate action(s) to
correct it. Then have your partner try again until you make it work.
- Copy their commandsD1 file to your directoryD1 with a new name of partner.
- You may log out, or continue with the following session.
Session D2
- Log into the system or change to your home directory.
- Change your default mask so that directories created in the future have permissions 664.
- Create a directory called temp in your home directory.
- Check the permissions of the temp directory.
If the permissions of the temp directory are not 664, delete it and start over.
- Delete the temp directory.
- Create a directory called directoryD2 under the directoryD directory.
- Check the permissions of this directory.
- Try to change to the directoryD2 directory. You should have a problem.
Make the necessary permission changes so that you can change to the directory.
- Now, change to the directoryD2 directory.
- Create a file named commandsD2 in this directory. It should
contain five lines of text, each containing the name and a very
short description of the commands: ls mkdir rm rmdir ln
- Print this file. (Remember that print in UNIX means print to the screen.)
- Check the permissions of directory directoryD2 and file commandsD2. Can users in your group copy this file? Can
they change this file? Can they execute this file? Can users outside your group copy this file? Can they
change this file? Can they execute this file?
- Change the permissions of directory directoryD2 and file commandsD2 so that every user can read, modify, but not
execute this file.
- Check the permissions of directory directoryD2 and file commandsD2 and change the permissions
if they are not correct.
- Log out of the system.
Submission session
Create a heading similar to the heading for assignment A.
Tommy Atkins replace with your name
CIS 18A
Winter 2011 replace with the current quarter
Assignment D replace with the current assignment letter
- Use the following command to create a file with your work from the assignment:
cat headingD sessionD1 sessionD2 > assignmentD.txt
-
Use e-mail or WinSCP to obtain a copy of assignmentA.txt.
Print it using notepad, or otherwise use the Courier New or other mono-space font.
- Turn in your printout to the instructor on time.