LPIC-1 (102): Manage User Accounts
9 Questions
1 Views

LPIC-1 (102): Manage User Accounts

Created by
@GuiltlessAshcanSchool

Questions and Answers

What is the command to add the editor group to the secondary groups of the user christian?

  • usermod -a -G editor christian (correct)
  • usermod -G editor christian
  • groupmod -a -G editor christian
  • groupadd -a editor christian
  • What do the third and fourth fields in /etc/gshadow contain?

  • Administrators and ordinary members (correct)
  • Group ID and group name
  • Group name and group ID
  • Ordinary members and administrators
  • Which of the following files are shadowed for security reasons?

  • /etc/group and /etc/gshadow
  • /etc/shadow and /etc/gshadow (correct)
  • /etc/passwd and /etc/group
  • /etc/passwd and /etc/shadow
  • What is the purpose of the /etc/shadow file?

    <p>To store password aging information</p> Signup and view all the answers

    What is the option to set the encoding of the original file in the iconv command?

    <p>-f</p> Signup and view all the answers

    What is the command to list all encoding supported by iconv?

    <p>iconv -l</p> Signup and view all the answers

    What is the purpose of using the iconv command?

    <p>To convert a file from one encoding to another</p> Signup and view all the answers

    How can you convert a file named old.txt from WINDOWS-1252 encoding to UTF-8 encoding using the iconv command?

    <p>iconv -f WINDOWS-1252 -t UTF-8 old.txt</p> Signup and view all the answers

    What is the purpose of the output redirection operator in the iconv command?

    <p>To redirect the output of the command to a file</p> Signup and view all the answers

    Study Notes

    Manage User and Group Accounts

    • User account information is stored in /etc/passwd and /etc/group files.
    • /etc/shadow and /etc/gshadow files store encrypted passwords and are readable only by root and shadow group members.
    • When shadow passwords are used, an x appears in the second field of /etc/passwd and /etc/group files.
    • The ls -l /etc/passwd /etc/group /etc/shadow /etc/gshadow command shows file permissions.

    User Account Properties

    • The minimum password lifetime for Catherine is not specified (set to 0).
    • The maximum password lifetime for Catherine is 99999 days.
    • The password warning period for Catherine is 7 days.
    • There is no inactivity period for Catherine's account.
    • Catherine's account never expires.

    Creating and Managing User Accounts

    • The useradd -m command creates a new user account with a home directory.
    • The usermod command is used to modify user account properties.
    • The getent command is used to review password aging information for a user account.

    Group Management

    • The getent command can be used to review group membership.
    • The usermod command can be used to add a user to a secondary group.
    • The cat /etc/group command shows group membership.
    • The cat /etc/gshadow command shows group administrators and members.

    Automating System Administration Tasks

    • Cron and at jobs can be used to schedule system administration tasks.
    • The /etc/cron.{d,daily,hourly,monthly,weekly}/ directories contain cron job files.
    • The /etc/at.deny and /etc/at.allow files control access to at services.
    • The crontab command is used to manage cron jobs.
    • The at command is used to schedule at jobs.
    • The atq and atrm commands are used to manage at jobs.
    • Systemd timer units can be used to automate system administration tasks.
    • The systemctl and systemd-run commands are used to manage systemd timer units.

    Scheduling Jobs with Cron

    • The crontab -e command is used to edit or create a crontab file.
    • The default editor is specified by the VISUAL or EDITOR environment variables.
    • In some distributions, the editor can be chosen from a list when crontab is run for the first time.
    • The format of a crontab entry is: minute hour day month day_of_week command.
    • Example: 0 10 * * * /home/frank/foo.sh runs the foo.sh script every day at 10:00 am.

    Creating System Cron Jobs

    • System crontabs are updated using an editor, not the crontab command.
    • The /etc/crontab file and files in /etc/cron.d must be edited manually.
    • The user account that will run the cron job must be specified in the crontab entry.
    • Example: 30 01 * * * root /root/barfoo.sh &gt;&gt;/root/output.log 2&gt;&gt;/root/error.log

    Configure Access to Job Scheduling

    • The /etc/cron.allow and /etc/cron.deny files are used to set crontab restrictions.
    • If /etc/cron.allow exists, only non-root users listed within it can schedule cron jobs.
    • If /etc/cron.deny exists, users listed within it cannot schedule cron jobs.

    Systemd Timer Units

    • systemd timer units can be used as an alternative to cron.
    • Timers are logged to the systemd journal.
    • The systemctl command is used to control systemd timer units.
    • Example: systemctl enable foobar.timer and systemctl start foobar.timer to enable and start a timer.

    Special Expressions for Job Execution

    • Special expressions can be used to describe particular frequencies for job execution:
      • hourly: run once an hour at the beginning of the hour.
      • daily: run once a day at midnight.
      • weekly: run once a week at midnight on Monday.
      • monthly: run once a month at midnight on the first day of the month.
      • yearly: run once a year at midnight on the first day of January.

    Managing Cron Jobs

    • The crontab command has options to display, remove, and specify the user whose crontab needs to be modified.
    • Example: crontab -l displays the current crontab, crontab -r removes the current crontab, and crontab -u user specifies the user whose crontab needs to be modified.

    Studying That Suits You

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

    Quiz Team

    Description

    Test your knowledge of managing user and group accounts, including password settings and system files, in Linux systems. This quiz covers LPIC-1 (102) Version 5.0 exam topics.

    More Quizzes Like This

    System Administration Quiz
    0 questions
    Linux Administration Overview
    18 questions
    Linux System Administration Basics
    10 questions
    Linux系統管理:用戶管理
    16 questions
    Use Quizgecko on...
    Browser
    Browser