Podcast
Questions and Answers
What is the command to add the editor group to the secondary groups of the user christian?
What is the command to add the editor group to the secondary groups of the user christian?
What do the third and fourth fields in /etc/gshadow contain?
What do the third and fourth fields in /etc/gshadow contain?
Which of the following files are shadowed for security reasons?
Which of the following files are shadowed for security reasons?
What is the purpose of the /etc/shadow file?
What is the purpose of the /etc/shadow file?
Signup and view all the answers
What is the option to set the encoding of the original file in the iconv command?
What is the option to set the encoding of the original file in the iconv command?
Signup and view all the answers
What is the command to list all encoding supported by iconv?
What is the command to list all encoding supported by iconv?
Signup and view all the answers
What is the purpose of using the iconv command?
What is the purpose of using the iconv command?
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?
How can you convert a file named old.txt from WINDOWS-1252 encoding to UTF-8 encoding using the iconv command?
Signup and view all the answers
What is the purpose of the output redirection operator in the iconv command?
What is the purpose of the output redirection operator in the iconv command?
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
andatrm
commands are used to manage at jobs. - Systemd timer units can be used to automate system administration tasks.
- The
systemctl
andsystemd-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 thefoo.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 >>/root/output.log 2>>/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
andsystemctl 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, andcrontab -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.
Related Documents
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.