Podcast
Questions and Answers
What do the permission bits determine?
What do the permission bits determine?
Which command would you use to inspect the values of the permission bits for a file?
Which command would you use to inspect the values of the permission bits for a file?
How many permission bits are associated with the owner of a file?
How many permission bits are associated with the owner of a file?
In octal representation, what value corresponds to the read bit for the file owner?
In octal representation, what value corresponds to the read bit for the file owner?
Signup and view all the answers
When a file is executed, what are the two types of executable files that might be encountered?
When a file is executed, what are the two types of executable files that might be encountered?
Signup and view all the answers
What does the execute bit on a directory allow you to do?
What does the execute bit on a directory allow you to do?
Signup and view all the answers
Which attribute is controlled by permissions on a file's parent directory?
Which attribute is controlled by permissions on a file's parent directory?
Signup and view all the answers
What is represented by the first digit in an octal number for permission bits?
What is represented by the first digit in an octal number for permission bits?
Signup and view all the answers
What does the first octal digit in a file specification represent?
What does the first octal digit in a file specification represent?
Signup and view all the answers
When using the mnemonic syntax for chmod, what does 'o' stand for?
When using the mnemonic syntax for chmod, what does 'o' stand for?
Signup and view all the answers
What does the command 'chmod 711 myprog' grant to the owner of the file?
What does the command 'chmod 711 myprog' grant to the owner of the file?
Signup and view all the answers
Which command is used to change the ownership of a file?
Which command is used to change the ownership of a file?
Signup and view all the answers
If you need to change a file's group ownership, what is a requirement?
If you need to change a file's group ownership, what is a requirement?
Signup and view all the answers
Which octal digit in a four-digit chown command represents the special bits?
Which octal digit in a four-digit chown command represents the special bits?
Signup and view all the answers
Which flag is used with chown and chgrp to change settings recursively?
Which flag is used with chown and chgrp to change settings recursively?
Signup and view all the answers
What permission combination is represented by the octal number '7'?
What permission combination is represented by the octal number '7'?
Signup and view all the answers
What is one challenge associated with the organization of UNIX file systems?
What is one challenge associated with the organization of UNIX file systems?
Signup and view all the answers
Which directory is specifically designated for temporary files in the UNIX file system?
Which directory is specifically designated for temporary files in the UNIX file system?
Signup and view all the answers
What combination of bits allows the contents of a directory to be listed?
What combination of bits allows the contents of a directory to be listed?
Signup and view all the answers
Which command can be used to determine the type of an existing file?
Which command can be used to determine the type of an existing file?
Signup and view all the answers
Where is the operating system kernel typically located?
Where is the operating system kernel typically located?
Signup and view all the answers
What does the setgid bit do when set on a directory?
What does the setgid bit do when set on a directory?
Signup and view all the answers
What does the sticky bit prevent when set on a directory?
What does the sticky bit prevent when set on a directory?
Signup and view all the answers
What is a common characteristic of the /etc directory in UNIX systems?
What is a common characteristic of the /etc directory in UNIX systems?
Signup and view all the answers
Which of the following is NOT a standard file type defined by most filesystem implementations?
Which of the following is NOT a standard file type defined by most filesystem implementations?
Signup and view all the answers
Which octal value corresponds to the setuid bit?
Which octal value corresponds to the setuid bit?
Signup and view all the answers
Why is it recommended to leave the file tree organization unchanged in UNIX systems?
Why is it recommended to leave the file tree organization unchanged in UNIX systems?
Signup and view all the answers
Which command provides a detailed listing of files and directories?
Which command provides a detailed listing of files and directories?
Signup and view all the answers
To enable programs to access files that would otherwise be off-limits, which bits need to be set on the executable file?
To enable programs to access files that would otherwise be off-limits, which bits need to be set on the executable file?
Signup and view all the answers
Which option describes the purpose of the 'ls -ld' command?
Which option describes the purpose of the 'ls -ld' command?
Signup and view all the answers
Which attributes are mostly of concern to a system administrator according to the content?
Which attributes are mostly of concern to a system administrator according to the content?
Signup and view all the answers
Which of the following statements about the setgid bit is true?
Which of the following statements about the setgid bit is true?
Signup and view all the answers
What does the umask command do in a Unix-like system?
What does the umask command do in a Unix-like system?
Signup and view all the answers
What is the purpose of the a flag in Linux file attributes?
What is the purpose of the a flag in Linux file attributes?
Signup and view all the answers
What characterizes an Access Control List (ACL)?
What characterizes an Access Control List (ACL)?
Signup and view all the answers
Which of the following is NOT a way that ACLs can be implemented in a Linux system?
Which of the following is NOT a way that ACLs can be implemented in a Linux system?
Signup and view all the answers
Which command is used to view file attributes including Linux bonus flags?
Which command is used to view file attributes including Linux bonus flags?
Signup and view all the answers
What type of permissions can advanced ACL systems allow administrators to specify?
What type of permissions can advanced ACL systems allow administrators to specify?
Signup and view all the answers
Which command is NOT typically used to manipulate POSIX ACLs?
Which command is NOT typically used to manipulate POSIX ACLs?
Signup and view all the answers
How is the umask specified?
How is the umask specified?
Signup and view all the answers
Study Notes
File Tree Organization
- UNIX systems have never been well-organized.
- Various incompatible naming conventions.
- Different types of files can be scattered randomly.
- Files are often divided by function instead of the frequency of changes.
- /etc directory contains files that are never customized and files that are entirely local.
- It is not recommended to change the default organisation due to hidden dependencies.
- Root filesystem contains the root directory, minimal set of files and subdirectories.
- OS kernel lives under /boot.
- /etc directory holds critical system and configuration files
- /sbin and /bin are for important utilities
- /tmp is often used for temporary files.
- /dev has traditionally be part of the root filesystem, but now it is a virtual filesystem mounted separately.
Standard Directories
- /bin contains essential binaries, accessible to all users.
- /boot contains files required for booting the system, including the kernel.
- /dev contains device files allowing interaction with hardware.
- /etc contains system-wide configuration files.
- /home contains user home directories.
- /lib contains libraries needed by many programs.
- /lost+found holds files recovered from a damaged filesystem.
- /mnt contains mount points for other filesystems.
- /media contains mount points for removable media (like USB drives).
- /opt contains optional software packages.
- /proc contains virtual filesystem representing running processes.
- /root is the home directory of the root user.
- /run contains runtime data, like system state and socket files.
- /sbin contains essential system binaries.
- /srv contains data for services (e.g., websites).
- /sys contains virtual filesystem representing hardware information.
- /tmp stores temporary files that are automatically deleted on reboot.
- /usr contains user programs and utility files.
- /var stores variable (changing) data, such as logs and mail.
File Types
- Seven types of files are defined:
- Regular files
- Directories
- Character device files
- Block device files
- Local domain sockets
- Named pipes (FIFOs)
- Symbolic links
- The "file" command can be used to determine the type of an existing file.
- Knowing the standard file types is important for understanding how systems operate.
File Attributes
- Nine permission bits determine which operations can be performed on a file by whom.
- Permission bits are grouped into three sets: owner, group, and other (everyone else).
- Each set has three bits: read, write, and execute.
- File permissions are represented using octal numbers (base 8) because each octal digit represents three bits.
- The top three bits (400, 200, 100) control access for the owner.
- The middle three bits (40, 20, 10) control access for the group.
- The bottom three bits (4, 2, 1) control access for everyone else.
File Attributes (cont.)
- For regular files:
- The read bit allows the file to be opened and read.
- The write bit allows the file's contents to be modified or truncated.
- The execute bit allows the file to be executed.
- For directories:
- the execute bit (often called the "search" bit) allows the directory to be entered.
- The read bit allows listing the contents of the directory.
- The write bit allows files to be created, deleted, and renamed within the directory.
Permissions
- The setuid (Set user ID) and setgid (Set group ID) bits can be set on executable files.
- When set, they allow programs to access files and processes that would otherwise be off-limits to the user running them.
- If the setgid bit is set on a directory, newly created files inherit the group ownership of the directory.
- The sticky bit (octal value 1000) on a directory prevents deleting or renaming files unless you are the owner of the directory, the owner of the file, or the superuser.
Inspecting File Attributes
- The
ls -l
(orls -ld
for directory) command displays details for a file. - Attributes displayed include link count, owner, group, mode, size, last access time, last modification time, and file type.
-
chmod
command is used to change the mode (permissions) of a file. -
chown
command changes a file’s ownership. -
chgrp
command changes its group ownership. -
umask
modifies the default permissions for newly created files. - The
lsattr
andchattr
commands view and change Linux's supplemental file flags (e.g., append-only or immutable).
Access Control Lists (ACLs)
- Access Control Lists are a more powerful but more complex way to regulate access compared to standard file permissions.
- An ACL is associated with each file or directory, and lists the permission rules.
- Each rule in an ACL is called an access control entry (ACE).
- An ACE identifies the user or group it applies to and specifies a set of permissions.
- ACL implementation can be done by the kernel, individual filesystems, or by higher-level software like NFS and SMB servers.
- Linux uses POSIX ACLs.
- Commands
getfacl
andsetfacl
are used to manipulate ACLs.
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.
Related Documents
Description
Test your knowledge about the organization of UNIX file systems, including the purpose of standard directories such as /bin, /etc, /boot, and /dev. Understand the rationale behind directory structure and file management in UNIX systems.