You are on page 1of 8

Nguyễn Văn Nhẫn B1809272

CHỦ ĐỀ: QUYỀN TRÊN HỆ THỐNG TẬP TIN


Mục tiêu
● Quyền trên hệ thống tập tin

Mô tả yêu cầu
Hãy trả lời các câu hỏi ở các trang 8, 13, 19, 28, 36, 42 trong file
FilePermission-Exercise.pdf và điền kết quả vào bảng sau

Trang 8 Câu hỏi Trả lời

1. Which users can read einstein's file a. elvis


theory? b. ventura
c. prince
d. pataki
e. einstein
f. alice

2. Which users can modify the census a. elvis


taken for nero? b. ventura
c. prince
d. pataki
e. einstein
f. alice

3. Which users can add their own entry to a. elvis


elvis's pacman.highscores? b. ventura
c. prince
d. pataki
e. einstein
f. alice

4. Which users can read governor pataki's a. elvis


budget? b. ventura
c. prince
d. pataki
e. einstein
f. alice

5. Which users can read alice's a. elvis


adventures? b. ventura
c. prince
d. pataki
e. einstein
f. alice
6. Which users can modify alice's a. elvis
adventures? b. ventura
c. prince
d. pataki
e. einstein
f. alice

Trang Câu hỏi Trả lời


13

1. Which of the following commands is a. chperm


used to modify a file's permissions? b. perms
c. chmod
d. chown
e. None of the above.

2. Select all of the following which are a. chmod u+r /tmp/foo


legitimate invocations of the chmod b. chmod ug+rw /tmp/foo
command. c. chmod rw-g /tmp/foo
d. chmod g+wu-r
/tmp/foo
e. chmod a-a /tmp/foo
f. chmod go+rwx
/tmp/foo

3. Which command would result in a. chmod a-rw sample.txt


sample.txt having permissions of rw-------? b. chmod og-rw
sample.txt
c. chmod u+rw
sample.txt
d. chmod u-rw sample.txt
e. chmod o-rw sample.txt

4. Which command would result in a. chmod a-w sample.txt


sample.txt having permissions of rw-r--r--? b. chmod go-w sample.txt
c. chmod go-rw
sample.txt
d. chmod g-w sample.txt
e. Both B and D

5. Which of the following commands would a. chmod a+r diary.txt


result in diary.txt having permissions of rw- b. chmod go+r diary.txt
r-- c. chmod u-w diary.txt
r--? d. chmod o+rw diary.txt
e. chmod ugo+r diary.txt
f. chmod ugo+rw
diary.txt

6. Which command would result in diary.txt a. chmod a+w diary.txt


having permissions of rw-rw-r--? b. chmod go+w diary.txt
c. chmod ug+rw diary.txt
d. chmod g+rw o+r
diary.txt
e. The desired
permissions cannot be
obtained using the chmod
command only once.

7. Which of the following commands would a. chmod a+rw sample.sh


result in sample.sh having permissions of b. chmod go+x sample.sh
rwxrwxr- c. chmod a+x sample.sh
X? d. chmod x+a sample.sh
e. Both C and D

8. Which of the following best explains why a. The owner would like
someone would want the file sample.sh to anyone to be able to
have remove the file.
permissions of rwxrwxr-x? b. The owner would like
anyone to be able to
modify the file.
c. The owner would like
anyone to be able
execute the file as a
script.
d. The owner would like
anyone to be able to
rename the file.
e. None of the above
reasons apply.

Trang Câu hỏi Trả lời


19

1. Which of the following commands is a. group


used to change the group owner of a file? b. chgroup
c. chgrp
d. changegroup
e. None of the above

2. Which of the following commands is a. owner


used to change the user owner of a file? b. chowner
c. chown
d. changeowner
e. None of the above

3. The user madonna wants members of a. chgrp music playlist


the group music to be able to read and b. chown music playlist
modify her playlist, and everyone else to c. chmod g+w playlist
only be able to read it. What steps must d. A, then C
she perform? e. She does not need to
do anything, this is
already the case.

4. The user ventura wants members of the a. chgrp wrestle slogans


group wrestle to be able to read his b. chmod g+w slogans
slogans, and everyone else to have no c. chmod o-r slogans
access to the file. What steps must he d. A and B
perform? e. All of the above

5. The user ventura wants members of the a. chgrp governor donors


group governor to be able to read his b. chmod g+r donors
donors, and c. chmod o-rw donors
everyone else to have no access to the file. d. A and B
What steps must he perform? e. B and C

6. What is the most likely explanation of a.ventura used the wrong


this error?(chgrp: changing group of syntax on the command
`antics': Operation not permitted) line.
b. ventura does not own
chgrp: root and the file owner (only to the file antics.
subscribed groups) c. ventura is not a
member of the group
music.
d. Only root can use the
chgrp command.
e. None of the above.

7. What must ventura do to successfully a. ventura must add


perform the operation? himself to the group
music.
b. ventura must get the
system administrator, as
root, to add him to the
group music.
c. ventura must first run
the newgrp command.
d. ventura must run
chmod g-rw antics
e. None of the above.

8. Which users on the system can modify a. ventura


the permissions on the file slogans? b. madonna
c. all members of the
group wrestle
d. root
e. all members of the
group music
9. You have just created the file foo.txt a. chgrp music foo.txt
(with default permissions). You would now b. chmod g+w foo.txt
like members c. chmod o-w foo.txt
of the group music to be able to read and d. A and B
modify the file, and everyone else to be e. A and C
able to read but
not modify it. What steps must you
perform?

10. You have just created the file foo.txt a. chgrp music foo.txt
(with default permissions). You would now b. chmod g-w foo.txt
like members c. chmod o-r foo.txt
of the group music to be able to read (but d. A and B
not modify) the file, and everyone else to e. All of the above
have no access.
What steps must you perform?

Trang Câu hỏi Trả lời


28

1 Which user can read the file a. elvis


governor/budget2001? b. ventura
c. prince
governor/budget2001 ventura governor - d. maxwell
rw-r--r--

2. Which user can modify the file a. einstein


physics/published/relativity? b. maxwell
physics/published/relativity einstein c. elvis
einstein -rw-rw-r-- d. blondie

3. Which users can modify the file a. elvis and einstein


music/drafts/little_orange_corvette? b. elvis, prince, and
music/drafts/ blondie
little_orange_corvette.txt prince music -rw- c. prince and einstein
rw-r-- d. only prince

4. Which users can create a new file in the a. only maxwell


directory physics/published/? b. maxwell and ventura
physics/published/ maxwell physics c. all users can
drwxrwxr-x d. elvis, maxwell, and
einstein

5. Which users can list files in the directory a. elvis, einstein, and
physics/? maxwell
b. only einstein
c. all users can
d. elvis, prince, and
blondie
6. Which users can list files in the directory a. elvis, einstein, and
music/? maxwell
b. only root
c. all users can
d. elvis, prince, and
blondie

7. Who can read the file a. All users


governor/budget2001? b. Only ventura
c. ventura and pataki
d. ventura and maxwell

8. Who can read the file a. All users


governor/budget2002? b. Only ventura
c. ventura and pataki
d. ventura and maxwell

9. Which users can read the file a. elvis, maxwell, and


physics/working/time_travel? einstein
b. only einstein
c. all users
d. einstein and maxwell

10. Which users can remove the file a. only blondie


music/contrib/stand_by_your_spam.txt? b. all users
c. elvis, maxwell, and
einstein
d. prince, blondie, and
elvis

Trang Câu hỏi Trả lời


36

1. Which octal notation below represents a. 751


permissions of rwxr-x--x? b. 762
c. 007
d. 267

2. Which octal notation below represents a. 551


permissions of rw-rw-r--? b. 664
c. 771
d. 660

3. Which permission represents the octal a. rwx---r--


notation 701? b. r-----rwx
c. rwx-----x
d. x-----rwx

4. Which permission represents the octal a. -w--w-rw-


notation 644? b. --x--x-wx
c. r-xr--r--
d. rw-r--r--

5. Which of the following would be the a. 750


most reasonable permissions for a b. 075
directory that members of only a c. 700
particularly group should have access to? d. 740

6. Which of the following would be the a. 006


most reasonable permissions for a file that b. 622
all users can read, but only the owner can c. 660
write? d. 644

Trang Câu hỏi Trả lời


42

1. If a process had a umask of 077, what a. r--r--r--


would be the default permissions for newly b. rw-rw-r--
created files? c. rwx------
d. rw-------

2. If you notice that newly created a. 077


directories have permissions of rwxr-x---, b. 027
what umask is being c. 227
used? d. 002

3. If a process had a umask of 077, what a. r--r--r--


would be the default permissions for newly b. rw-rw-r--
created c. rwx------
directories? d. rw-------

4. If you notice that newly created files a. 036


have permissions of rw-r-----, which of the b. 027
following c. 037
is a possible umask? d. all of the above

5. What umask would result in newly a. 022


created files with default permissions of b. 033
rwxr-xr-x? c. 011
d. It is impossible to have
newly created files with
the given permissions.

6. Why would you not expect to see a. Other users could not
someone set a shell's umask to 422? read newly created files
by default.
b. Users could not read
their own newly created
files.
c. Newly created files
with identical group and
other permissions are not
allowed.
d. A legitimate umask
cannot contain digits
higher than 2.

You might also like