107 Administrative Tasks KT Flashcards
107.1 Manage user and group accounts and related system files
The following is a partial list of the used files, terms and utilities:
/etc/passwd /etc/shadow /etc/group /etc/skel/ chage getent groupadd groupdel groupmod passwd useradd userdel usermod
/etc/passwd
/etc/passwd is a text file that contains the attributes of each user or account on a computer running Linux or another Unix-like operating system.
/etc/shadow
The /etc/shadow file stores actual password in encrypted format (more like the hash of the password) for user’s account with additional properties related to user password.
/etc/group
/etc/group is a text file which defines the groups to which users belong under Linux and UNIX operating system.
/etc/skel/
The /etc/skel directory contains files and directories that are automatically copied over to a new user’s home directory when such user is created.
chage
Command: The chage command changes the number of days between password changes and the date of the last password change.
chage [options] [LOGIN]
getent
Command: The getent command displays entries from databases supported by the Name Service Switch libraries, which are configured in /etc/nsswitch.conf.
getent [option]… database key…
groupadd
Command: The groupadd command creates a new group account using the values specified on the command line plus the default values from the system.
groupadd [options] group
groupdel
Command: The groupdel command modifies the system account files, deleting all entries that refer to group. The named group must exist.
groupdel group
groupmod
Command: The groupmod command modifies the definition of the specified GROUP by modifying the appropriate entry in the group database.
groupmod [options] GROUP
passwd
Command: The passwd command changes passwords for user accounts. A normal user may only change the password for his/her own account, while the superuser may change the password for any account.
passwd [options] [LOGIN]
useradd
Command: useradd is a low level utility for adding users. On Debian, administrators should usually use adduser(8) instead.
useradd [options] LOGIN
userdel
Command: The userdel command modifies the system account files, deleting all entries that refer to the user name LOGIN. The named user must exist.
userdel [options] LOGIN
usermod
Command: The usermod command modifies the system account files to reflect the changes that are specified on the command line.
usermod [options] LOGIN
107.2 Automate system administration tasks by scheduling jobs
The following is a partial list of the used files, terms and utilities:
/etc/cron.{d,daily,hourly,monthly,weekly}/ /etc/at.deny /etc/at.allow /etc/crontab /etc/cron.allow /etc/cron.deny /var/spool/cron/ crontab at atq atrm systemctl systemd-run
/etc/cron.{d,daily,hourly,monthly,weekly}/
/etc/cron.d
Location for additional system crontab configurations.
/etc/cron.daily
Contains scripts that will be executed once per day.
/etc/cron.hourly
Contains scripts that will be executed once per hour.
/etc/cron.monthly
Contains scripts that will be executed once per month.
/etc/cron.weekly
Contains scripts that will be executed once per week.
/etc/at.deny
The /etc/at.deny file contains a list of users who are not allowed to user the at command.
/etc/at.allow
The /etc/at.allow file contains a list of users who are allowed to use the at command.
/etc/crontab
The /etc/crontab file acts as the system crontab. This file enables the execution of system processes at specific intervals.
/etc/cron.allow
The /etc/cron.allow file contains a list of users who are allowed to use the crontab command.
/etc/cron.deny
The /etc/cron.deny file contains a list of users who are not allowed to use the crontab command.
/var/spool/cron/
This directory contains all users crontab entries and can only be viewed by the root user.
crontab
Command: Crontab is the program used to install, remove or list the tables used to drive the cron(8) daemon.
crontab [-u user] file
at
Command: Used to schedule one or more commands to be executed at one specific time in the future.
at [-V] [-q queue] [-f file] [-mldbv] TIME
atq
Command: List the current users at jobs.
atq [-V] [-q queue]
atrm
Command: Remove an at job before it is executed.
atrm [-V] job [job…]
systemctl
Command: systemctl may be used to introspect and control the state of the “systemd” system and service manager.
systemctl [OPTIONS…] COMMAND [UNIT…]
systemd-run
Command: systemd-run may be used to create and start a transient .service or .scope unit and run the specified COMMAND in it.
systemd-run [OPTIONS…] COMMAND [ARGS…]
107.3 Localisation and internationalisation
The following is a partial list of the used files, terms and utilities:
/etc/timezone /etc/localtime /usr/share/zoneinfo/ LC_* LC_ALL LANG TZ /usr/bin/locale tzselect timedatectl date iconv UTF-8 ISO-8859 ASCII Unicode
/etc/timezone
This is the location of the system timezone on Debian based systems.
/etc/localtime
This is where the system timezone is set on Red Hat based distributions.
/usr/share/zoneinfo/
This directory contains a list of all zone files, either directly in the directory or in sub-directories.
LC_*
LC_* refers to a collection of locale settings that are used to change the way the shell and other programs handle differences based on geographic region.
LC_ALL
LC_ALL will override all other locale settings.
LANG
LANG will provide a default locale value when set.
TZ
The TZ variable can be used to set a different timezone than the system default.
/usr/bin/locale
This is the default locale archive location.
tzselect
Command: The tzselect is a menu driven, CLI-based tool that allows a user to select a timezone.
tzselect
timedatectl
Command: Displays the system clock, UTC, and timezone information.
date
Command: Displays the system clock.
iconv
Command: The iconv program reads in text in one encoding and outputs the text in another encoding.
UTF-8
UTF-8 (8-bit Unicode Transformation Format) is a variable width character encoding capable of encoding all 1,112,064 valid character code points in Unicode using one to four one-byte (8-bit) code units.
ISO-8859
ISO/IEC 8859 is a joint ISO and IEC series of standards for 8-bit character encodings.
ASCII
American Standard Code for Information Interchange(ASCII) is an English-only encoding format that is limited to 128 characters. Extended ASCII can support additional, non-English characters.
Unicode
Unicode is an information technology standard for the consistent encoding, representation, and handling of text expressed in most of the world’s writing systems.