Linux User Management Quiz
41 Questions
0 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

What is the maximum number of days a password may be used before expiration according to the given settings?

  • 180 days (correct)
  • 30 days
  • 60 days
  • 90 days
  • What does PASS_MIN_DAYS represent in the password policy?

  • Maximum allowed password length
  • Number of days warning given before password expires
  • Minimum number of days allowed between password changes (correct)
  • Minimum number of days before a password can be reused
  • How many days of warning are given before a password expires according to the settings?

  • 30 days
  • 7 days (correct)
  • 0 days
  • 14 days
  • Which command is used to edit the configuration file to set password expiration to 180 days?

    <p>vim /etc/login.defs</p> Signup and view all the answers

    What is the purpose of the supplementary group created in the lab exercise?

    <p>To provide users with root command privileges using sudo</p> Signup and view all the answers

    What is the purpose of a group in a system?

    <p>To provide a structure for organizing users and their access to resources.</p> Signup and view all the answers

    What does the 'x' represent in a line from the /etc/group file?

    <p>An obsolete group password field.</p> Signup and view all the answers

    How is the primary group for a user typically designated?

    <p>It shares the same name as the primary user.</p> Signup and view all the answers

    What is a characteristic of supplementary groups?

    <p>They allow for access to files across different categories.</p> Signup and view all the answers

    Where is the group membership for users stored?

    <p>In the /etc/group file.</p> Signup and view all the answers

    What does the id command display for a user?

    <p>The group membership including both primary and supplementary groups.</p> Signup and view all the answers

    What is a User Private Group?

    <p>A group that is created with the same name as a user.</p> Signup and view all the answers

    What command is used to switch to the root user in a login shell?

    <p>sudo su -</p> Signup and view all the answers

    What does the command 'echo $PATH' display?

    <p>Directories for executable files</p> Signup and view all the answers

    If more than five minutes have passed since the last authentication, what must the user do to run 'sudo' again?

    <p>Re-authenticate with the student password</p> Signup and view all the answers

    What does the command 'id' return when run by the root user?

    <p>User and group information</p> Signup and view all the answers

    What happens to the PATH variable when using 'sudo' to become the root user?

    <p>It is overridden for security reasons.</p> Signup and view all the answers

    After switching to root, what would be the output of 'pwd'?

    <p>/root</p> Signup and view all the answers

    What is the primary effect of using 'sudo' instead of 'su' directly?

    <p>It enhances security by overriding the PATH variable.</p> Signup and view all the answers

    Which command must be run to display the home directory of the root user?

    <p>echo $HOME</p> Signup and view all the answers

    What does the prompt of the root user typically look like compared to a regular user?

    <p>It starts with a hash symbol.</p> Signup and view all the answers

    Which command is used to exit the root user shell and return to the student user's shell?

    <p>exit</p> Signup and view all the answers

    What command should be used to lock a user account using sudo?

    <p>sudo usermod -L user02</p> Signup and view all the answers

    What will happen if a user tries to execute the sudo command without having permission?

    <p>An email will be sent to the root user detailing the attempt.</p> Signup and view all the answers

    Which of the following commands provides access to the root account without running interactive login scripts?

    <p>sudo -s</p> Signup and view all the answers

    What is the purpose of using the visudo command?

    <p>To edit the sudoers file safely and check for syntax errors.</p> Signup and view all the answers

    How can a member of the wheel group use sudo under Red Hat Enterprise Linux 7?

    <p>By using their own password for any command.</p> Signup and view all the answers

    What does the % symbol indicate in the sudoers file configuration?

    <p>It indicates a group in the configuration.</p> Signup and view all the answers

    What log file is used to record executed sudo commands by default?

    <p>/var/log/secure</p> Signup and view all the answers

    Which of the following best describes the sudo -i command?

    <p>It switches to the root account and runs the user's default shell.</p> Signup and view all the answers

    Which user is specifically notified when there is an unauthorized attempt to use a sudo command?

    <p>The root user</p> Signup and view all the answers

    What does the command 'ALL=(ALL:ALL)' allow for users in the wheel group?

    <p>Run commands as any user and any group on the system</p> Signup and view all the answers

    How can you provide sudo access to a user named user01?

    <p>Create the /etc/sudoers.d/user01 file with 'user01 ALL=(ALL) ALL'</p> Signup and view all the answers

    What is the meaning of the NOPASSWD command in a sudoers file?

    <p>Users can run commands without a password</p> Signup and view all the answers

    Which of the following is a correct line for granting the games group permission to run the id command as the operator user?

    <p>%games ALL=(operator) /bin/id</p> Signup and view all the answers

    What security measure is recommended when using sudo with NOPASSWD?

    <p>Enable SSH public-key authentication</p> Signup and view all the answers

    How can you tighten security after enabling sudo access?

    <p>Re-enable the requirement for passwords for sudo</p> Signup and view all the answers

    What does the inclusion of files in /etc/sudoers.d affect?

    <p>Provides a way to manage sudo access for users and groups separately</p> Signup and view all the answers

    What command configuration would prevent the ec2-user from executing commands as root without a password?

    <p>ec2-user ALL=(ALL) ALL</p> Signup and view all the answers

    Which statement about the wheel group in this context is correct?

    <p>Users not in this group cannot use sudo</p> Signup and view all the answers

    Which command should be used to provide full sudo access to the group group01?

    <p>%group01 ALL=(ALL) ALL</p> Signup and view all the answers

    Study Notes

    Manage Local Users and Groups

    • User accounts provide security boundaries between users and programs
    • Users are identified by usernames and unique identification numbers (UIDs)
    • Passwords are assigned to prove user authorization
    • Processes run as a particular user
    • Files have owners, controlling access
    • User accounts include superusers (root), system users, and regular users
    • Superusers (root) have full system access

    User Account Types

    • Superuser: Administers the system, has a UID of 0 (root)
    • System users: Perform supporting services
    • Regular users: Limited access, for daily work

    Linux System Security

    • User accounts crucial for system security
    • Every program/process runs with a user ID (UID) or a user type
    • File access control determined by owner and access privileges
    • User accounts are essential to control file access
    • System uses UIDs to identify users in the database

    User Information Files

    • /etc/passwd: Stores user information (username, UID, GID, comment, home directory, shell)
    • /etc/shadow: Stores encrypted passwords (security improvement)

    User commands

    • id: Displays user information (UID, GID, groups) for the currently logged-in user or a specified user
    • ls -l: Lists file details; includes owner and permissions; for directories, the owner
    • ps: Lists process information, including the associated UID for the process
    • su: Switches to another user account
    • sudo: Enables users to run commands with superuser privileges

    Group Concepts

    • Groups combine users with shared access to system resources
    • Group names are used for easier recognition; systems use an ID for each group
    • /etc/group: Stores group information (group name, GID, members)

    Primary and Supplementary Groups

    • Every user has a primary group
    • Users can have supplementary group memberships, granted in /etc/group
    • These memberships grant broader access permissions

    Gaining Superuser Access

    • Systems use the root user for elevated privileges
    • sudo command runs a command with root privileges without having the root password
    • su command switches to another user account or root account when no user specified
    • su and sudo commands are used to switch between users

    Understanding Su and Sudo

    • su: Direct switch to another user account, often root; may require password.
    • sudo: Run a command with root privileges; Authenticate with your own password.

    Run Commands with Sudo

    • When the root user account isn't accessible users can use the sudo command
    • sudo ensures users have the correct user account permissions.
    • sudo prevents users from having direct access to root

    Studying That Suits You

    Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

    Quiz Team

    Related Documents

    Description

    Test your knowledge of managing local users and groups in Linux systems. This quiz covers the importance of user accounts, different user types, and Linux system security principles. Understand user identification and file access control mechanisms in a secure environment.

    More Like This

    Linux User and Group Management
    5 questions
    Linux User Accounts Quiz
    48 questions

    Linux User Accounts Quiz

    DelectableLearning8178 avatar
    DelectableLearning8178
    Use Quizgecko on...
    Browser
    Browser