Skip to main content

Posts

LPI E C1 - umask test

LPIC-1 (Linux Administrator) 104.5 Manage file permissions and ownership Candidates should be able to control file access through the proper use of permissions and ownership. Some questions taken from this blog: https://www.certificationmethods.com/2023/05/lpi-e-umask-control.html   Practice Test Questions 1. Which of the following statements best describes the purpose of the "umask" command in Linux? a) It displays the current system time. b) It sets the permissions for a file or directory when it is created. c) It changes the ownership of a file or directory. d) It lists all the files and directories in a given directory. /* --------------------- */ -------------------------- Answer 1 Below:  -------------------------- /* --------------------- */ Explanation: It sets the permissions for a file or directory when it is created. The umask command allows you to determine the default permissions that are subtracted from the maximum allowable default permiss...

LPI E - Owners Test 4

Linux Essentials NDG Linux Essentials English 0423: Ownership and Permissions Scenarios - from Netacad.com Question 1: Based on the following information, what access would the user bob have on the file abc.txt? drwxr-xr-x. 17 root root 4096 23:38 / drwxr-xr--. 10 root root 128 03:38 /data -rwxr-xr--. 1 bob bob 100 21:08 /data/abc.txt /* --------------------- */ -------------------------- Answer 1 Below:  -------------------------- /* --------------------- */ Explanation: Initially it would appear that the user bob can view the contents of the abc.txt file as well as copy the file, modify its contents and run it like a program. This erroneous conclusion would be the result of looking solely at the file's permissions (rwx for the user bob in this case). However, to do anything with the file, the user must first "get into" the /data directory. The permissions for bob for the /data directory are the permissions for "others" (r--), which means bob can't e...

LPI E - Get Sticky

5.3 Managing File Permissions and Ownership Understanding and manipulating file permissions and ownership settings Understanding Concepts with Questions Sticky Bit What is the effect of setting the "sticky bit" on a directory in Linux? a. Only the owner of the directory can modify its contents. b. Files within the directory can only be modified by their owner or the owner of the directory. c. Users can only create files within the directory, but cannot delete or modify existing files. d. The directory becomes invisible to other users.   The correct answer is option c. Users can only create files within the directory, but cannot delete or modify existing files. Explanation: The "sticky bit" is a special permission that can be set on a directory in Linux. When the sticky bit is set on a directory, it has a specific effect on how users can interact with the files within that directory. By setting the sticky bit on a directory, users are allowed to create files within t...

LPI E - GID UID Test

5.3 Managing File Permissions and Ownership Understanding and manipulating file permissions and ownership settings Practice Exam Scenarios 1 Scearios #2 Here: https://www.certificationmethods.com/2023/05/lpi-e-permissions-test.html Scenario 1: You are a system administrator managing a file server that stores sensitive data. You want to ensure that only the owner of a file can delete it, while other users have read and execute permissions. Which special permission should you set? a) Sticky Bit b) Set GID c) Set UID d) None of the above /* --------------------- */ -------------------------- Answer 1 Below:  -------------------------- /* --------------------- */ Explanation: In this scenario, setting the Sticky Bit on the parent directory ensures that only the file owner can delete their files. The Sticky Bit restricts the deletion or renaming of files within a directory to the owner, even if other users have write permissions. This helps maintain data security and prevents accident...