107 Administrative Aufgaben
107.1 Benutzer- und Gruppenkonten und dazugehörige Systemdateien verwalten
Kandidaten sollten in der Lage sein, Benutzerkonten hinzuzufügen, zu entfernen, vorübergehend zu deaktivieren und zu verändern.
Wichtigste Wissensgebiete
- Benutzer und Gruppen hinzufügen, ändern und entfernen
- Benutzer- und Gruppeninformationen in password/group-Datenbanken verwalten
- Spezielle und beschränkte Konten anlegen und verwalten
/etc/passwd /etc/shadow /etc/group /etc/skel chage groupadd groupdel groupmod passwd useradd userdel usermod groups
/etc/passwd
root:~ # man passwd | sed -n '69,145p' -a, --all Diese Option kann nur in Verbindung mit -S verwendet werden und führt dazu, dass der Status aller Benutzer angezeigt wird. -d, --delete Löscht das Passwort eines Benutzers (macht es leer). Dies ist ein schneller Weg, um das Passwort eines Kontos zu deaktivieren. Dem Konto ist dann kein Passwort zugeordnet. -e, --expire Lässt das Passwort eines Kontos sofort verfallen. Im Ergebnis kann damit erreicht werden, dass ein Benutzer beim nächsten Login das Passwort ändern muss. -h, --help Zeigt die Hilfe an und beendet das Programm. -i, --inactiveINAKTIV Mit dieser Option wird ein Konto deaktiviert, nachdem das Passwort für eine bestimmte Anzahl von Tagen abgelaufen ist. Wenn ein Benutzerkonto ein abgelaufenes Passwort für länger als INAKTIV Tage hatte, kann sich der Benutzer nicht mehr auf diesem Konto anmelden. -k, --keep-tokens Indicate password change should be performed only for expired authentication tokens (passwords). The user wishes to keep their non-expired tokens as before. -l, --lock Lock the password of the named account. This option disables a password by changing it to a value which matches no possible encrypted value (it adds a ´!´ at the beginning of the password). Note that this does not disable the account. The user may still be able to login using another authentication token (e.g. an SSH key). To disable the account, administrators should use usermod --expiredate 1 (this set the account's expire date to Jan 2, 1970). Users with a locked password are not allowed to change their password. -n, --mindays MIN_DAYS Setzt die Anzahl von Tagen, die mindestens zwischen zwei Änderungen eines Passworts vergehen müssen, auf MIN_TAGE. Ein Wert von Null in diesem Feld bedeutet, dass der Benutzer sein Passwort jederzeit ändern darf. -q, --quiet Stiller Modus. -r, --repositoryPASSWORTDEPOT change password in REPOSITORY repository -S, --status Display account status information. The status information consists of 7 fields. The first field is the user's login name. The second field indicates if the user account has a locked password (L), has no password (NP), or has a usable password (P). The third field gives the date of the last password change. The next four fields are the minimum age, maximum age, warning period, and inactivity period for the password. These ages are expressed in days. -u, --unlock Unlock the password of the named account. This option re-enables a password by changing the password back to its previous value (to the value before using the -l option). -w, --warndaysWARN_TAGE Legt die Anzahl der Tage fest, an denen der Benutzer eine Warnung erhält, bevor sein Passwort ungültig wird. Die Option WARN_TAGE bezeichnet die Anzahl der Tage, für die ein Benutzer vor Verfall seines Passworts gewarnt wird. -x, --maxdaysMAX_TAGE Bestimmt die maximale Anzahl von Tagen, die das Passwort gültig bleibt. Nach MAX_TAGE Tagen muss das Passwort geändert werden.
groups
- Gruppenmitgliedschaften des BENUTZERNAMEns oder, wenn kein BENUTZERNAME angegeben ist, die des aktuellen Benutzer ausgeben.
groups www-data www-data : www-data
wall
Wall sends a message to everybody logged in with their mesg(1) permission set to yes. The message can be given as an argument to wall, or it can be sent to wall's standard input. When using the standard input from a terminal, the message should be terminated with the EOF key (usually Control-D).
/etc/issue & /etc/issue.net
/etc/issue and /etc/issue.net files can be used to print any logon messages to users logging on to a Linux machine, the message appears BEFORE the login prompt of the login console.
Many escape sequences can also be used in these files to print important information about the system onto the console
The issue.net file has same features and properties the only difference being that the /etc/issue.net file holds the information that is display to users logon in via telnet some escape characters that can be used are mentioned in the table below
\d Insert the current date. \o Insert the domain name of the system. \r Insert the release number of the kernel, e.g., 2.4.20. \s Insert the system name, the name of the operating system. \t Insert the current time. \u Insert the number of current users logged in. v Insert the version of the OS. \n Insert the node name of the machine, also known as the hostname. \m Insert the architecture identifier of the machine, e.g., i686
/var/run/utmp
- Dies ist eine weitere binäre Datei, die Informationen zu den derzeit eingeloggten Benutzern enthält. Die Befehle who, w und finger erstellen daraus Login-Informationen.
- Wenn nicht für Others lesbar sehen sie nicht wer eingeloggt ist.
root@homaar-pc:/etc/X11# ls -lah /var/run/utmp -rw-rw-r-- 1 root utmp 5,7K 13. Jan 08:39 /var/run/utmp
107.2 Systemadministrationsaufgaben durch Einplanen von Jobs automatisieren
Kandidaten sollten in der Lage sein, cron oder anacron zu verwenden, um Jobs in regelmäßigen Abständen auszuführen, und at, um Jobs zu einem bestimmten Zeitpunkt auszuführen.
Wichtigste Wissensgebiete
- Cron- und at-Jobs verwalten
- Zugriffsrechte auf die Dienste cron und at konfigurieren
/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
107.3 Lokalisierung und Internationalisierung
Kandidaten sollten in der Lage sein, ein System in einer anderen Sprache als Englisch zu lokalisieren. Dazu gehört auch ein Verständnis dafür, warum LANG=C in Shellskripten nützlich ist.
Wichtigste Wissensgebiete
- Locale-Einstellungen
- Zeitzonen-Einstellungen
/etc/timezone /etc/localtime /usr/share/zoneinfo Umgebungsvariablen: LC_* LC_ALL LANG /usr/bin/locale tzselect tzconfig date iconv UTF-8 ISO-8859 ASCII Unicode
The compiled zoneinfo file appears to be platform and architecture independent, so if you have multiple machines to update you should be able to move the file as-is without running zic again. Similarly, you can just to pull updated zoneinfo files from a machine running a different Debian release, or even download the latest tzdata package from unstable, extract the zoneinfo files from within the .deb file, and install them into the /usr/share/zoneinfo directory tree.