100% found this document useful (2 votes)
222 views

Linux Test 4

The document contains questions about Linux file permissions, user accounts and commands. It asks about permissions categories for Linux files, the UID of the root account, octal file permission modes, effects of the umask command, viewing file permissions with ls, reasons for permission denied errors, information contained in /etc/passwd and /etc/shadow files, using chmod to change permissions, currently logged in users with who, creating users with useradd, and properties of the su command.

Uploaded by

Dimi Comboeanu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
222 views

Linux Test 4

The document contains questions about Linux file permissions, user accounts and commands. It asks about permissions categories for Linux files, the UID of the root account, octal file permission modes, effects of the umask command, viewing file permissions with ls, reasons for permission denied errors, information contained in /etc/passwd and /etc/shadow files, using chmod to change permissions, currently logged in users with who, creating users with useradd, and properties of the su command.

Uploaded by

Dimi Comboeanu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

On a Linux file, permissions can only be assigned to the following categories of

users:

a. server,group,others
b. owner,server,others
c. owner,group,others
d. owner,group,secondary group
e. host,server,others
f. owner,others,world
g. no answer

What is the UID of the Linux account that has the full set of privileges in the Linux
operating system?

a. 1000
b. 1
c. 100
d. 0
e. no answer

Which octal mode describes the file permissions rwSr-x-wx?

a. 4653
b. 2644
c. 5733
d. 1433
e. 0755
f. no answer
A user issues the following commands:

[user1@computer]$ umask 035


[user1@computer]$ touch f1

Assuming that file f1 didn't previously exist and was created without any errors, what
will be its permissions?

a. rw-r---w-
b. rw-r---wx
c. rw-r-x-wx
d. rw--w----
e. rw-r-x-w-
f. rw--wxr--
g. no answer

Which option of the ls command can be used to view file permissions?

a. -a
b. -c
c. -i
d. -p
e. -l
f. no answer

You try to copy a file, using the cp command, from a subdirectory into a directory for
which you have rwx permissions. Both source file and source subdirectory have the
permissions rw-r-xr--. You get a permission denied message. What would cause this
message to be displayed?

a. you do not have the write permission


b. you are not part of the group that has execute permission
c. the file system has insufficient inodes
d. you are not part of the others group
e. you do not own the file
f. no answer
All of the following information is contained on each line from the /etc/passwd
file, EXCEPT:

a. user's primary group


b. user's default shell
c. UID
d. username
e. path to user's home directory
f. user's password hash
g. no answer

You would like to make sure that nobody outside yourself and your group can read
the file evil_plan.doc. You check the permissions and find that they are rwxr-xr--.
Which of the following commands should be used to allow only owner and group
access?

a. chmod go+r evil_plan.doc


b. chmod o+r evil_plan.doc
c. chmod a+r evil_plan.doc
d. chmod -r evil_plan.doc
e. chmod o-r evil_plan.doc
f. no answer
Please choose the answer that correctly matches the types of accounts below with
their descriptions:

a) root account
b) system account
c) user account

1) an account that is used for interactive log in and has a limited set of privileges
2) an account that has the full set of privileges in the operating system
3) an account that is used for running services and is not allowed to log in interactivel
y

a. 1-a, 2-b, 3-c


b. 1-c, 2-b, 3-a
c. 1-b, 2-a, 3-c
d. 1-c, 2-a, 3-b
e. 1-a, 2-c,3-b
f. no answer

When using the chmod command to change permissions on a Linux file, the set of
permissions may be specified using the following modes: (choose two)

a. octal mode
b. decimal mode
c. symbolic mode
d. enhanced mode
e. hexadecimal mode

A directory listing displays rw-r----x user1 admin 580 Dec 11 12:45 resume.doc for
the file resume.doc. You are a member of the admin group and you are logged in
as user2. What permissions do you have for the file resume.doc?

a. read only
b. read and execute
c. none
d. write only
e. read and write
f. execute only
g. no answer
Which of the following commands will display the list of users that are currently
logged in on a Linux system?

a. who
b. last
c. lastlog
d. wc
e. no answer

Which of the folowing commands will create a new Linux user account with a
username of john having the home directory set to /users/john and the user id 504?

a. adduser -u john -i 504


b. useradd -d /users/john -U 504 -u john
c. adduser -u 504 -d /users/john -john
d. useradd -u 504 -d /users/john john
e. useradd -u 504 -d /users/john
f. no answer

Which of the following files does NOT store user account or group data?

a. /etc/shadow
b. /etc/password
c. /etc/gshadow
d. /etc/group
e. /etc/passwd
f. no answer

You have issued the command chmod 775 file1 where file1 is a file in the current
directory. What will be the resulting permissions applied to file file1, as shown by
the ls -l command?

a. rwxr--r--
b. rwxrw-rw-
c. rw-rw-rw-
d. rwxrwxrwx
e. rwxrwxr-x
f. no answer
You get a permission denied message when trying to remove a file from the current
directory. What could be the reason?

a. you do not have the write permission on the parent directory of the current
directory
b. you do not have the write permission on the file
c. you do not have the read permission on the file
d. you do not have the execute permission on the file
e. you do not have the write permission on the current directory
f. no answer

All of the following information is contained on each line of


the /etc/shadow file, EXCEPT:

a. the maximum number of days between two consecutive password


changes
b. username
c. the date of the last password change
d. UID
e. password hash
f. the minimum number of days between two consecutive password
changes
g. no answer

Which of the following uniquely identifies a user in the Linux operating system?

a. PID
b. SID
c. GID
d. UID
e. no answer
Which of the following is NOT true about the su Linux command?

a. if executing su with no arguments, the target user will automatically


be root
b. the CTRL-c key combination can be used for exiting a su session
c. upon successful execution, it starts a new shell that runs with the
privileges of the desired user
d. if the - character is specified as one of the arguments of the su command,
the desired user's environment will be used
e. it is used for executing commands as another user
f. no answer

Which command gives the owner of the file script1.sh read, write and execute
permissions and also grants group permissions of read and execute?

a. chmod u-rwx,g-rx script1.sh


b. chmod a=rx script1.sh
c. chmod u=rwx,g=rx script1.sh
d. chmod o=rwx,g=rx script1.sh
e. chmod a=rwx script1.sh
f. no answer

Which of the following are special permissions that can be set on a Linux file?
(choose three)

a. sticky
b. read
c. setUID
d. write
e. setGID
f. execute

You might also like