You are on page 1of 6

St Mary’s University

Department of Computer Science

Unix system administration and support - INTE 440

Name: TSEGAYE SHUMET Sec: SPECIAL CLASS DUE: _______________

LAB 7: Refer “Supp_3” + your textbook “teach yourself Linux” pages 322-327 on
“file permission” to assist you finish this assignment.

1. symbolic mode:

Directions: Give only one line of command. Do not give more than one line of
command to accomplish each request below. Assume question a-e is continuous.
take a screen shot and attach output for each of the steps from a-f.

a) A Create a file using your lastname in your home working directory. Display
long list or file permission information for the file you created. (use: ls -l
filename) File permission info:

touch Shumet
ls -l Shumet
-rw-rw-r-- 1 bball bball 0 Aug 25 08:11 Shumet
b) B Take away read and execute permission for everyone not in your group using
assignment operator.

Command: chmod go=w Shumet


Definition : we set the exact access by using (=)

c) C Display current permission information for the file. (use: ls -l filename) current
file permission info:

ls -l Shumet

-rw -w- -w- 1 bball bball 0 Nov 25 08:50 Shumet

d) D. You can read and write it, but nobody else can touch it, read it, modify it, or
anything else. Use only + or - operator.
Command: chmod go-rwx Shumet
e) Display current permission information for the file. (use: ls -l filename) current
file permission info:

ls -l Shumet
-rw --- --- 1 bball bball 0 Nov 25 08:50 Shumet

f) E. delete the file you created. mdel Shumet or rm Shumet

2. numeric mode

a) assmue: directory path is: /home/d1 and both home and d1 are directory.
you wanted to have the directory above set so that you (owner) have all
access, people in your group can look at the contents but not modify
anything, and everyone else is shut out, how would you do it? Give full
command in numeric mode. Command

rwx - - - - - -

b) Fill the numeric mode equivalent for the access permission status given below.
Permission Numeric
--- --- --- 000
r- - - - - - - - 400
r- - r- - r- - - 444
rw- - - - - - - 600
rw- r- - r- - 644
rw- rw- r- - 664
rw- rw- rw- 666
rwx - - - - - - 700
rwx r-x - - - 750
rwx r-x r-x 755

c) Observe the data in (b) above. Which access permission appear to work
withdirectories. Why? Note: two separtate answers.

rwx - - - - - - 700
the user (owner) can view, modify and enter the directory.
rwx r-x - - - 750
in this section the user (owner) can view, modify and enter the directory. And also
the group can view and enter the directory.
rwx r-x r-x 755
here also the user (owner) can view, modify and enter the directory.
The group can view and enter the directory.
Others(world) also have the same permission as the group

The execute (x) permission lets users move (cd) into directories

d) Which access permission appear to work with files? Why? Note: two separate
answers.

rw- - - - - - - 600
the user can add and remove files
rw- r- - r- - 644
user can add and remove files
rw- rw- r- - 664
user and group can add and
remove files
rw- rw- rw- 666
user, group and others can
add and remove files
rwx - - - - - - 700
only user can add and remove files
rwx r-x - - - 750
user and group can add and remove files
rwx r-x r-x 755

user, group and others can add and remove files

The write (w) permission lets users add and remove files.

Direction: Execute every instruction in (a-d). Take a screen shot and attach output for all
the steps.

3. numeric mode: give command in numeric mode.


(a) create a file called example1, and display its permission status. what is its current file
access permission in numeric:

numeric mode= 644


(b) Take away read and write permission for people in group,command: file access
permission(mode) in numeric after change:

numeric mode =604

(c) What if you change your mind and want to open the file up for everyone to read
orwrite?

Numeric mode = 666


(d) Finally, pretend that the example is actually a directory. What numeric mode would
you specify to enable everyone to use ls command in the directory and enable only
the owner to add or delete files?

Direction: Execute every instruction in (a-i). Take a “screen shot” and attach output for
all the steps from (a-j)

4. directory permission scenarios.

(a) Create a directory using your last name in your home working directory.
(b) Display file access permission information for the directory you created.File
access info:
(use: ls -ld directory name) to display the info for a directory. But make sure you are
located in the “parent directory” of the directory you just created.

(c) Create a file using your first name and put a one line statement in the file.
Place the file in the directory you created in (a) above.

Display the content of the file.

(d) Display access permission information for the file you created.
File access info:

(e) switch to the directory you created and execute: chmod -x filename
Note: filename is the name of the file you created under the directory.

(f) switch to the parent of the directory you created and execute: chmod -x
directoryname
Note: directoryname is the name of the directory you created.

(g) Display a one line current access permission information for both the file and
directory you created.
File access info:_____________________
Directory access info:________________

(h) Display the content of your file that is under the directory you created.Were you able
to see the content? YES/NO
Write the response you got from UNIX:_____________________________

(i) If your answer is NO in (h), then give reason why you think you are denied. Reason:

(j) Propose the right command below that would fix this situation.
Note: you should be able to display the content of your file.
Symbolic mode:_________________________
Numeric mode:__________________________

You might also like