MODULE 18- Special directories and files Flashcards
What happens when the setuid permission is set on an executable binary file?
→ The file is executed with the permissions of the file owner, not the user who runs it.
What does a lowercase “s” in the file permissions (e.g., rwsr-xr-x) indicate?
→ It indicates that the setuid permission is set and the execute permission is also set for the user.
Which symbolic command would you use to add the setuid permission to a file?
→ chmod u+s file
Why is setuid used on certain system utilities like passwd?
→ It allows normal users to run these utilities with root privileges to access files like /etc/shadow.
What does an uppercase “S” in the file permissions (e.g., rwSr-xr-x) indicate?
→ It indicates that the setuid permission is set but the execute permission for the user is not set.
What happens when a directory with the setgid permission creates another directory?
→ Any new directory created within a setgid directory will inherit the setgid permission, meaning it will also be owned by the group that owns the parent directory.
How do you remove the setuid permission using the symbolic method?
→ chmod u-s file
How would you add the setuid permission numerically, given that the original file permissions are 775?
→ chmod 4775 file
Which permission allows a user to run an executable file with the group permissions of the file, effectively giving them temporary access to the group that owns the file.
setgid permission on a file
How can you identify the setgid permission on a file using ls -l?
→ The setgid permission is indicated by an “s” in the group’s execute position (e.g., -rwxr-sr-x).
Which command allows you to setgid numerically?
add 2000 to the file’s existing permissions.
What problem does the setgid permission solve in the scenario with users bob, sue, and tim working on a shared directory?
→ Without setgid, files created by one user are owned by their primary group, potentially preventing other users in the shared directory from accessing those files. Setgid ensures files are owned by the shared group.
Which command allows you to setuid numerically?
add 4000 to the file’s existing permissions.
Which permission prevents users from deleting files they do not own in a shared directory, allowing only the owner of the file or the root user to delete files?
The sticky bit permission.
Which data structure contains file metadata like permissions, ownership, and timestamps (but not the file name)?
→ The inode table.
What command can be used to view the inode number of a file?
→ ls -i <file></file>
Define the concept described as “two file names pointing to the same inode number.”
→ Hard link.
What makes two files hard-linked copies of each other?
→ They share the same inode number.
What command is used to create a hard link?
→ ln target link_name
What is the file type indicator for a symbolic link in ls -l output?
→ l (lowercase L) as the first character in the permissions string.
What is the main identifier for a file in the filesystem?
→ The inode number, not the file name.
What does the arrow (->) in symbolic link listings indicate?
→ The target file that the link points to.
Which type of link is described as a file that points to another file by its path?
→ Symbolic link (soft link).
What command and option are used to create a symbolic link?
→ ln -s target link_name