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.