Linux - Copied from midterm review (answers) Flashcards
For hardening purposes, what is the primary benefit of having the file /etc/shadow?
It stores encrypted user passwords, making them unreadable directly.
Which of the following represents the symbolic permission to give the owner read and write access, the group only read access, and others no access?
u=rw,g=r,o=-
If a Linux file has the permissions -rw-r–r–, who has the ability to write to the file?
Only the owner
Which of the following files contains encrypted passwords of users?
/etc/shadow
Setting the ‘s’ bit on a file in the user ownership does which of the following:
All processes created using that file run with the user ownership of the command file
To be able to change into directory Dir1, what is the minimum permissions necessary for the Dir1 directory?
Execute (x)
What is the octal permission of a directory that allows the owner to access files if they know their names, but not to list or to change the file names?
100
Setting the ‘s’ bit on a directory in the group ownership does which of the following:
All files created in that directory will have the same group ownership as the parent directory
The UID and GID for a user can be found in which file?
/etc/passwd
The /etc/group file contains information about:
Group memberships
For system hardening purposes, how can an administrator restrict a specific user from using the sudo command to gain superuser privileges?
Explicitly deny the user in the /etc/sudoers file or associated configurations.
In the context of Linux access controls, what does DAC stand for?
Discretionary Access Control
Setting the ‘s’ bit on a file in the group ownership does which of the following:
All processes created using that file run with the group ownership of the command file
In an empty directory, you run the commands: touch ??? * ; chmod 111 * chmod 444 ??? ; chmod 666 ‘*’ ; chmod 333 * What permissions are on file ??? after above commands?
-wx -wx -wx
What is the octal mode of a directory that allows only the user to cd into it and list the names in it and create any new files?
700
Which command is used to change the ownership of a file in Linux?
chown
Which of the following commands is used to show the user’s own identity and group information?
id
Which of the following commands can be used to change the ownership of a file in Linux?
chown
Which file in Linux contains the encrypted passwords of users?
/etc/shadow
Which command is used to modify an existing user’s information in Linux?
usermod
Which of the following commands is used to change a user’s default login shell?
chsh
In the file /etc/group, what does the last field represent?
List of users
What is the easiest way for root to allow a regular user in Red Hat Enterprise Linux to run any administrator commands with sudo?
Add the user to the wheel group
What value of umask gives the permissions below to a new file: rw-rw-r–
2
You are working at the Linux command line and your username is “homer”. You execute the command ls and see the following output: -rw-rw-r– 1 homer homer 387 Nov 28 08:26 bigfoot -rwxr-xr-x 1 homer homer 1851882 Nov 28 08:26 dragon -rwxrwxr-x 1 homer homer 15957213 Nov 28 08:26 kraken What command can you type which will remove execute permission from the file dragon for all users except yourself?
chmod 744 dragon
Refer to the exhibit above. What would be the permissions of f1.txt after executing the last command?
700
When hardening a server system, which account should have its direct login access blocked?
Root user
In a Linux system, which account type is created for running specific services or applications?
System users
If an administrator wants to efficiently manage multiple users’ default settings upon creation, which directory plays a critical role?
/etc/skel
What Linux command can be used to set the default permissions for all newly created files?
umask
Which command allows you to view the groups a user belongs to?
id
If an administrator wishes to prevent a specific user from using the sudo command, they should edit which file?
/etc/sudoers
What command is used to create a new group?
groupadd
To ensure a user cannot directly log into the system, which shell should be assigned in /etc/passwd?
/bin/nologin
In a multi-user GNU/Linux environment, which command is the safest to use when changing a user’s default shell?
chsh
What Linux command can be used to change the group of a file?
chgrp
You are working at the Linux command line. What command can you type which will result in a new file being given the following permissions by default: - The file owner can read and write to the file, but not execute it. - Everyone other than the owner can read the file, but not write to or execute it.
umask 133
The filename /etc/passwd is a(n) _________________.
Absolute path
Which of the following is not true of the root user?
The root user can access any computer on the network.
Which Access Control Technique is based on security labels and is mandatory regardless of the user’s wishes?
MAC