Podcast
Questions and Answers
What happens when the Setuid bit is set on an executable file?
What happens when the Setuid bit is set on an executable file?
The Setgid bit influences the permissions of an executable file only.
The Setgid bit influences the permissions of an executable file only.
False
What is an example of a command that uses the Setuid permission?
What is an example of a command that uses the Setuid permission?
passwd
The Setgid bit ensures that files created in a directory inherit the directory's ______.
The Setgid bit ensures that files created in a directory inherit the directory's ______.
Signup and view all the answers
Match the following special permissions with their functions:
Match the following special permissions with their functions:
Signup and view all the answers
What will the file permissions look like when the Setuid bit is set for the owner?
What will the file permissions look like when the Setuid bit is set for the owner?
Signup and view all the answers
The Sticky Bit is specifically used to grant elevated permissions to executable files.
The Sticky Bit is specifically used to grant elevated permissions to executable files.
Signup and view all the answers
Which command would you use to set the Setgid bit on a directory?
Which command would you use to set the Setgid bit on a directory?
Signup and view all the answers
What does the Setuid permission do?
What does the Setuid permission do?
Signup and view all the answers
The Setgid permission ensures that newly created files within a directory inherit the owner's permissions.
The Setgid permission ensures that newly created files within a directory inherit the owner's permissions.
Signup and view all the answers
What command is used to add the Sticky Bit to a directory?
What command is used to add the Sticky Bit to a directory?
Signup and view all the answers
PAM stands for __________.
PAM stands for __________.
Signup and view all the answers
Match the PAM module with its purpose:
Match the PAM module with its purpose:
Signup and view all the answers
Which type of PAM module is responsible for checking if a user's account is valid?
Which type of PAM module is responsible for checking if a user's account is valid?
Signup and view all the answers
PAM allows only one authentication method to be used per service.
PAM allows only one authentication method to be used per service.
Signup and view all the answers
What is the purpose of the Sticky Bit in a directory?
What is the purpose of the Sticky Bit in a directory?
Signup and view all the answers
A configuration file for PAM is typically located in __________.
A configuration file for PAM is typically located in __________.
Signup and view all the answers
Match the following PAM types with their descriptions:
Match the following PAM types with their descriptions:
Signup and view all the answers
Which of the following is a common module for enforcing password strength?
Which of the following is a common module for enforcing password strength?
Signup and view all the answers
PAM allows system administrators to define authentication policies for applications in multiple locations.
PAM allows system administrators to define authentication policies for applications in multiple locations.
Signup and view all the answers
What happens when an application requests authentication through PAM?
What happens when an application requests authentication through PAM?
Signup and view all the answers
The command to set Setgid on a directory is __________.
The command to set Setgid on a directory is __________.
Signup and view all the answers
Study Notes
chmod
Special Permissions
-
s
inchmod
refers to Setuid or Setgid permissions, affecting file/directory access.
Setuid (Set User ID)
- Purpose: Allows running an executable with the owner's permissions, temporarily.
- How it Works: Executes a file as if run by the owner of the file.
-
Example:
passwd
command—updates passwords with root privileges. -
Setting Setuid:
chmod u+s file
(adds to owner)
Setgid (Set Group ID)
- Purpose: Allows running an executable with the group's permissions, temporarily. Applies group ownership to newly created files/directories inside.
- How it Works: Temporarily runs with group permissions. Used for shared directories; ensures created files inherit the same group ownership.
- Example: Shared team directory where all files belong to the team.
-
Setting Setgid:
chmod g+s directory
(adds to group)
Sticky Bit (t
)
- Sticky bit, although not an
s
, is a special permission frequently used withchmod
. On directories, only owner or root can delete/rename files, even if others have write access.
Examples and Use Cases
-
Setuid (Binary): Example program requiring temporary root privileges.
- Owner:
root
- Permissions appear as:
-rwsr-xr-x 1 root root 12345 Jan 7 14:00 program
- Owner:
-
Setgid (Directory): Shared team directory with group ownership inheritance.
- Permissions appear as:
drwxrwsr-x 2 user team 4096 Jan 7 14:00 directory
- Permissions appear as:
-
Sticky Bit with Setgid: Group collaboration with file security in a directory.
- Permissions appear as:
drwxrwsr-t 2 user team 4096 Jan 7 14:00 dir
Pluggable Authentication Modules (PAM)
- Purpose: A framework for flexible & centralized user authentication in Unix-like systems.
Key Features of PAM
- Pluggable: Uses modular "plugins" (modules) for authentication tasks.
- Centralized: Defines policies for all applications in one place (config files).
- Customizable: Services (e.g., SSH, sudo, login), can have unique authentication rules.
How PAM Works
- Application Request: Application requests authentication from PAM.
- PAM Processes: PAM consults its config files to determine modules needed.
- Results: Modules handle specific tasks, and PAM returns a success/fail result to the application.
PAM Configuration
-
Location:
/etc/pam.d/
(or/etc/pam.conf
) -
Syntax:
[type] [control] [module-path] [arguments]
describes each module and its behavior—controls, module path, etc.
PAM Module Types and Examples
-
auth
: User authentication. -
account
: Checks account validity. -
password
: Manages password updates. -
session
: Sets up/tears down user sessions. -
pam_unix.so
: Traditional password authentication. -
pam_ldap.so
: LDAP (directory service) authentication. -
pam_tally2.so
: Tracks failed login attempts, locks accounts after failures. -
pam_cracklib.so
: Enforces password strength rules. -
pam_mkhomedir.so
: Automatically creates home directories on initial login.
PAM Examples in Action
-
SSH Authentication (
/etc/pam.d/sshd
): Combining modules for flexible authentication. -
Password Strength: Enforces strong passwords using
pam_cracklib
. -
Account Lockout: Locks accounts after repeated login failures using
pam_tally2
.
Advantages of PAM
- Flexible: Customize authentication policies easily.
- Centralized: Manage authentication across multiple services uniformly.
- Extensible: Add new authentication methods (e.g, biometric).
- Interoperable: Integrates with outside systems (e.g., LDAP, Kerberos).
Conclusion
- PAM provides centralized & flexible user authentication in Unix-like systems, enhancing security and simplifying system administration.
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.
Description
Test your knowledge on special permissions in Unix using chmod, including Setuid, Setgid, and the Sticky Bit. This quiz will help you understand how these permissions affect file access and group ownership. Perfect for anyone looking to deepen their understanding of Unix permissions.