LCA User & Permission Management 5 β Questions and Answers
Question 1: Which command displays all groups a user 'eve' belongs to?
- cat /etc/group | grep eve
- groups eve
- id -Gn eve
- Both B and C are correct (Correct answer)
Correct answer: Both B and C are correct
Both 'groups eve' and 'id -Gn eve' list all group memberships for a specified user.
Question 2: What is the default umask value for regular users on most Linux distributions?
- 0022 (Correct answer)
- 0077
- 0002
- 0755
Correct answer: 0022
The default umask for regular users is typically 0022, giving new files 644 and new directories 755 permissions.
Question 3: Which command grants user 'frank' the ability to run any command as root via sudo without a password prompt?
- echo 'frank ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
- usermod -s /bin/sudo frank
- visudo and add 'frank ALL=(ALL) NOPASSWD: ALL' (Correct answer)
- chmod u+s /usr/bin/sudo
Correct answer: visudo and add 'frank ALL=(ALL) NOPASSWD: ALL'
The correct and safe method is using visudo to edit /etc/sudoers, which validates syntax before saving.
Question 4: What does the 'x' in the password field of /etc/passwd indicate?
- The account is disabled
- The account has no password
- The password is stored in /etc/shadow (Correct answer)
- The password uses MD5 hashing
Correct answer: The password is stored in /etc/shadow
An 'x' in the password field of /etc/passwd means the actual hashed password is stored in the shadowed /etc/shadow file.
Question 5: A file has ACL permissions. Which command displays the ACL entries for file 'data.txt'?
- ls -la data.txt
- getfacl data.txt (Correct answer)
- stat data.txt
- chmod -l data.txt
Correct answer: getfacl data.txt
getfacl displays the Access Control List entries for a file, including extended ACL permissions beyond standard rwx.
Question 6: Which numeric UID range is typically reserved for system accounts on Linux?
- 0β99
- 0β999 (Correct answer)
- 1000β9999
- 500β999
Correct answer: 0β999
On most modern Linux distributions, UIDs 0β999 are reserved for system/service accounts, with regular users starting at 1000.
Question 7: What happens when 'chmod o-r file.txt' is executed?
- Removes read permission from the owner
- Removes read permission from the group
- Removes read permission from others (Correct answer)
- Removes read permission from owner and group
Correct answer: Removes read permission from others
The 'o' in chmod symbolic notation refers to 'others', so o-r removes read permission from the others category.
Which command displays all groups a user 'eve' belongs to?