Chapter-6: CONTROLLING ACCESS TO FILES WITH LINUX FILE SYSTEM PERMISSIONS

 

Chapter -6

 

CONTROLLING ACCESS TO FILES WITH LINUX FILE SYSTEM PERMISSIONS

 

1.       1. Which is not true?

a.       r (read) permission - Contents of the file can be read. Contents of the directory (file names) can be listed

b.      w (write) permission - Contents of the file can be changed. Any file in the directory may be created or deleted.

c.       x (exec) permission -  Files can be executed as commands. Contents of the directory can be accessed (dependent on the permissions of the files in the directory).

d.      r (read) permission - Contents of the file can be read. Contents of the directory (file names) can not  be listed

e.      w (write) permission - Contents of the file can not be changed. Any file in the directory may be created or deleted.

 

2.     2.   The option of the ‘ls’ command will expand the file listing to include both the permissions of a file and the ownership:

a.       –l                    b. –d                      c. –ls                      d. –s     

 

3.      3.  To prevent the descent into the directory and see the expanded listing of the directory itself, add the ----  option to ‘Is’

a.       –l                    b. –d                      c. –ls                      d. –s

 

4.     4.


Fill up the blanks by above options

Is owned by f red and readable by all users     = rfile1 

Contents may be modified by the user betty   = lfill2

 Can be deleted by the user fred                       = all

 Can not be read by the user barney                 = rfile2

Has a group ownership of wilma                      =lfile1

Can be deleted by the user barney                    = none


5.        What is true?

a.       r=4, w=2, and x=1

b.      r=3, w=2, and x=1

c.       r=2, w=4, and x=1

d.      r=4, w=2, and x=3

 

2.       6.Which command is used to modify the permission of a file/directory?

a.       chown

b.      chgrp

c.       chmod

 

 

3.      7.  Add execute permission for everyone on file2, which is true?

a.       chmod u+x file2

b.      chmod o+x file2

c.       chmod g+x file2

d.      chmod a+x file2

 

4.      8.  Remove read and write permission for group and other on file1

a.       chmod   g-rw   file1

b.      chmod   o-rw   file1

c.       chmod   go-rw   file1

d.      chmod   gu-rw   file1

e.      chmod   ao-rw   file1

 

5.       9.Set read, write, and execute permission for user, read, and execute for group, and no permission for other on ‘sampledir’, which is true?

a.       chmod   757   sampledir

b.      chmod   050   sampledir

c.       chmod   550   sampledir

d.      chmod   750   sampledir

 

6.      10.  The chmod commands supports the ------- option for recursively setting permissions on an entire directory tree

a.       –r

b.      –R

c.       –P

d.      –p 

 

7.      11. set read and write access on ‘demodir’ and all its children for their group owner, but will only apply execute permissions to directories, not regular files. Which is true?

a.       chmod   -R    g+rwx    demodir

b.      chmod   -R    o+rwX    demodir

c.       chmod   -R    g+rwX    demodir

d.      chmod   -R    u+rwx    demodir

 

8.      12.  File/Directory ownership can be changed with the ----------- command

a.       chown

b.      chmod

c.       chgrp

13.  File/Directory group ownership can be changed with the ----------- command

a.       chown

b.      chmod

c.       chgrp

14.       The chown command can also be used to change both owner and group at the same time.

a.       True                               b. False

 

15.       Ensure the permissions of directory - ‘ateam-text’ forbids others from accessing its files.

a.       chmod    750    ateam- text

b.      chmod    752    ateam- text

c.       chmod    o:---    ateam- text

d.      chmod    750    ateam- text

 

16.       Change the group ownership of the ‘ateam-text’ directory to ‘team’ under home directory.

a.       chown    :ateam     /home/ateam-text

b.      chgrp       ateam     /home/ateam-text

c.       chgrp      :ateam     /home/ateam-text

d.      chown    ateam     /home/ateam-text

 

17.       Remove write permission  from ‘itbd’ file for all  users

a.       chmod  ugo-r  itbd

b.      chmod  a-w  itbd

c.       chmod  ugo-w  itbd

d.      chmod  u-w,g-w,o-w   itbd

e.      chmod  u-w;g-w;o-w   itbd

18.       Append “I want to be an engineer”  to a file named ‘itbd’

a.       echo   “I want to be an engineer”   >   itbd

b.      echo   “I want to be an engineer”   >> itbd

c.       echo  >  “I want to be an engineer”     itbd

d.      echo   >> “I want to be an engineer”   itbd

 

19.       The ---------  for a directory sets a special restriction on deletion of files.

a.       suid

b.      sgid

c.       sticky bit

 

20.       What is right value?

a.       setuid = 1;     setgid = 4;       sticky = 2

b.      setuid = 2;     setgid = 4;       sticky = 1

c.       setuid = 1;     setgid = 2;       sticky = 4

d.      setuid = 4;     setgid = 2;       sticky = 1

 

21.       File executes as the user that owns the file, not the user that ran the file. What you will use?

a.       u + g

b.      g + s

c.       o + s

d.      o + t

e.      u + s

 

22.       File executes as the group that owns the file. What you will use?

f.        u + g

g.       g + s

h.      o + s

i.         o + t

j.        u + s

 

 23.   Users with write on the directory can only remove files that they own; they cannot remove or force saves to files owned by other users. What you will use?

k.       u + g

l.         g + s

m.    o + s

n.      o + t

o.      u + s


24. Set the setgid bit, and read/write/execute for user and group on ‘itbd’ directory.

a. chmod   2770    itbd 

b. chmod   1770    itbd 

c. chmod   4770    itbd 

d. chmod   0770    itbd 


25. The system default umask values for Bash shell users are defined in the --- files

a. /etc/profile 

b. /etc/.bashrc

c. /etc/bashrc

d. /etc/bashrc


26. By which command  you can change the created files/directories

a. mask

b. umask

c. unmask


27. default umask value applied on directories

a. 023

b. 022

c. 002

d. 222


28. default umask value applied on files

e. 023

f. 022

g. 002

h. 222


29. If you want to files & directories permission 622 & 733 respectively for root user, which command will be used?

a. umask   044

b. umask    077

c. umask    066

d. umask   023


30. Default umask value is

a. For super user = 002    ;    For standard user = 022

b. For super user = 002    ;    For standard user = 002

c. For super user = 022    ;    For standard user = 002

31. Default file/folder permission for super user is –

a. File = 644    ;   Directory = 754

b. File = 755    ;   Directory = 644

c. File = 664    ;   Directory = 775

d. File = 644    ;   Directory = 755


32. Default file/folder permission for standard user is –

e. File = 644    ;   Directory = 754

f. File = 755    ;   Directory = 644

g. File = 664    ;   Directory = 775

h. File = 644    ;   Directory = 755


33. If you want to change the ownership of user=mushfiq  &  group=itbd of a file named ‘test’, what command is used?

a. chown  :mushfiq  test

b. chown   :itbd   test

c. chown   mushfiq:itbd    test

d. chmod   mushfiq:itbd    test


34. Change the umask for user ‘mushfiq’  that new files are created with read-only access for the group and no access for other users.

a. umask   027

b. umask   025

c. umask   070

d. umask   040


35. If you want to set default umask value as 027  for   ‘mushfiq’  user  permanently, what you will do?

a. echo "umask 027" >> /home/mushfiq/.bash_profile

b. echo "umask 027" >> /home/mushfiq/.bashrc

c. echo "umask 027" >> /etc/bashrc

d. echo "umask 027" >> /etc/profile 


36. If you want to set default umask value as 027   for all standard   users except root user, what you will do?

a. vim   /etc/bashrc   ;  replace  first  umask  value  as  ‘umask  027’  ;  save  

b. vim   /etc/profile   ;  replace  first  umask  value  as  ‘umask  027’  ;  save      

c. vim   /etc/bashrc   ;  replace  second  umask  value  as  ‘umask  027’  ;  save      

d. vim   /etc/profile   ;  replace  second  umask  value  as  ‘umask  027’  ;  save      


 

 


Comments

  1. Red Prism Group ins one of the best Django coaching in Noida. Learn Django from industry expert with practical training, live projects and got your certificate.

    ReplyDelete

Post a Comment

Popular posts from this blog

Some Questions for MTCNA Exam

ডিপ্লোমা লেভেল এর ইন্ডাস্ট্রিয়াল এটাচমেন্ট এ আসার পূর্বে একটু ভেবে আসার অনুরোধ রইলো

Basic Router & Switch IOS commands