Files
2026-10-30 10:11:43 +01:00

286 lines
20 KiB
JSON
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{
"$schema": "../schema/questions.schema.json",
"format": "lpic-sim-questions",
"meta": {
"file": "questions_107.json",
"brief": "Fragen zu Topic 107 Administrative Aufgaben (LPIC-1 102-500, Objectives 5.0)",
"author": "Björn Runden <br@runden.de>",
"owner": "Björn Runden <br@runden.de>",
"assist": "KI-unterstützt (Claude Opus 5.5), geprüft von Björn Runden <br@runden.de>",
"version": "0.1.0 (29.10.2026)"
},
"exam": "lpic1-102",
"questions": [
{
"id": "107.1-001",
"objective": "107.1",
"type": "single",
"difficulty": 1,
"question": "In welcher Datei stehen auf aktuellen Linux-Systemen die Passwort-Hashes der Benutzerkonten?",
"options": [
{ "id": "a", "text": "`/etc/shadow`", "correct": true, "explanation": "Nur für root lesbar; enthält Hash und Daten zur Passwort-Alterung." },
{ "id": "b", "text": "`/etc/passwd`", "correct": false, "explanation": "Für alle lesbar; im Passwortfeld steht nur `x` als Verweis auf `/etc/shadow`." },
{ "id": "c", "text": "`/etc/group`", "correct": false, "explanation": "Enthält Gruppen und ihre Mitglieder." },
{ "id": "d", "text": "`/etc/gshadow`", "correct": false, "explanation": "Enthält Gruppenpasswörter und Gruppenadministratoren." },
{ "id": "e", "text": "`/etc/login.defs`", "correct": false, "explanation": "Enthält Vorgaben, z. B. UID-Bereiche und Standardwerte der Passwort-Alterung." }
],
"explanation": "Felder von `/etc/shadow`: Name, Hash, letzte Änderung, min, max, Warnung, Inaktivität, Ablaufdatum, reserviert.",
"references": ["man 5 shadow"]
},
{
"id": "107.1-002",
"objective": "107.1",
"type": "single",
"difficulty": 1,
"question": "Was steht im **siebten** (letzten) Feld eines Eintrags in `/etc/passwd`?",
"options": [
{ "id": "a", "text": "Die Login-Shell", "correct": true, "explanation": "z. B. `/bin/bash` oder `/usr/sbin/nologin` für Konten ohne Anmeldung." },
{ "id": "b", "text": "Das Home-Verzeichnis", "correct": false, "explanation": "Das ist das sechste Feld." },
{ "id": "c", "text": "Das GECOS-Feld (Kommentar, voller Name)", "correct": false, "explanation": "Das ist das fünfte Feld." },
{ "id": "d", "text": "Die primäre Gruppen-ID", "correct": false, "explanation": "Das ist das vierte Feld." },
{ "id": "e", "text": "Die Benutzer-ID", "correct": false, "explanation": "Das ist das dritte Feld." }
],
"explanation": "Aufbau: `name:x:UID:GID:GECOS:home:shell`, z. B. `anna:x:1001:1001:Anna:/home/anna:/bin/bash`.",
"references": ["man 5 passwd"]
},
{
"id": "107.1-003",
"objective": "107.1",
"type": "fill",
"difficulty": 2,
"question": "Der Benutzer `anna` soll zusätzlich in die Gruppe `docker` aufgenommen werden, **ohne** seine übrigen Zusatzgruppen zu verlieren. Geben Sie den Befehl ein.",
"answers": ["usermod -aG docker anna", "usermod -a -G docker anna", "usermod -G docker -a anna", "usermod --append --groups docker anna", "gpasswd -a anna docker"],
"explanation": "`-G` allein ersetzt die Liste der Zusatzgruppen; erst `-a` (append) hängt an. Die Änderung wirkt erst nach erneuter Anmeldung (oder mit `newgrp`).",
"references": ["man 8 usermod", "man 1 gpasswd"]
},
{
"id": "107.1-004",
"objective": "107.1",
"type": "single",
"difficulty": 1,
"question": "Mit welchem Befehl legt man den Benutzer `bob` an und erzeugt dabei gleich sein Home-Verzeichnis (mit Inhalt aus `/etc/skel`)?",
"options": [
{ "id": "a", "text": "`useradd -m bob`", "correct": true, "explanation": "`-m` (`--create-home`) legt das Home-Verzeichnis an und kopiert `/etc/skel`." },
{ "id": "b", "text": "`useradd -d /home/bob bob`", "correct": false, "explanation": "`-d` legt nur den Pfad fest, erzeugt das Verzeichnis aber nicht." },
{ "id": "c", "text": "`useradd -s /bin/bash bob`", "correct": false, "explanation": "`-s` setzt nur die Login-Shell." },
{ "id": "d", "text": "`useradd -g users bob`", "correct": false, "explanation": "`-g` setzt die primäre Gruppe." },
{ "id": "e", "text": "`useradd -k /etc/skel bob`", "correct": false, "explanation": "`-k` wählt das Vorlagenverzeichnis und wirkt nur zusammen mit `-m`." }
],
"explanation": "Ob `useradd` ohne `-m` ein Home anlegt, hängt von `CREATE_HOME` in `/etc/login.defs` ab. Debian bietet zusätzlich das interaktive `adduser`.",
"references": ["man 8 useradd"]
},
{
"id": "107.1-005",
"objective": "107.1",
"type": "multi",
"difficulty": 2,
"question": "Mit welchen Befehlen sperrt man das Passwort des Kontos `carl`, sodass keine Anmeldung per Passwort mehr möglich ist?",
"options": [
{ "id": "a", "text": "`usermod -L carl`", "correct": true, "explanation": "`-L` setzt ein `!` vor den Hash in `/etc/shadow`." },
{ "id": "b", "text": "`passwd -l carl`", "correct": true, "explanation": "`passwd -l` sperrt ebenfalls durch Voranstellen von `!`; `-u` entsperrt." },
{ "id": "c", "text": "`passwd -d carl`", "correct": false, "explanation": "`-d` löscht das Passwort – je nach Konfiguration ist dann sogar eine Anmeldung ohne Passwort möglich." },
{ "id": "d", "text": "`chage -l carl`", "correct": false, "explanation": "`chage -l` zeigt nur die Alterungsinformationen an." },
{ "id": "e", "text": "`userdel -l carl`", "correct": false, "explanation": "`userdel` löscht Konten; eine Option `-l` zum Sperren gibt es nicht." }
],
"explanation": "Eine Passwortsperre verhindert keine Anmeldung per SSH-Schlüssel. Komplett sperren: zusätzlich Ablaufdatum setzen (`usermod -e 1` bzw. `chage -E 0`) oder Shell auf `nologin`.",
"references": ["man 8 usermod", "man 1 passwd"]
},
{
"id": "107.1-006",
"objective": "107.1",
"type": "single",
"difficulty": 2,
"question": "Der Benutzer `dora` soll sein Passwort spätestens alle 90 Tage ändern müssen. Welcher Befehl setzt das?",
"options": [
{ "id": "a", "text": "`chage -M 90 dora`", "correct": true, "explanation": "`-M` setzt die maximale Gültigkeit des Passworts in Tagen." },
{ "id": "b", "text": "`chage -m 90 dora`", "correct": false, "explanation": "`-m` ist die Mindestdauer zwischen zwei Änderungen." },
{ "id": "c", "text": "`chage -W 90 dora`", "correct": false, "explanation": "`-W` legt fest, wie viele Tage vorher gewarnt wird." },
{ "id": "d", "text": "`chage -E 90 dora`", "correct": false, "explanation": "`-E` setzt das Ablaufdatum des Kontos (Datum oder Tage seit 1.1.1970)." },
{ "id": "e", "text": "`chage -I 90 dora`", "correct": false, "explanation": "`-I` legt die Inaktivitätsfrist nach Ablauf des Passworts fest." }
],
"explanation": "`chage -l dora` zeigt die aktuellen Werte. Dieselben Felder lassen sich teils auch mit `passwd -n/-x/-w/-i` setzen.",
"references": ["man 1 chage"]
},
{
"id": "107.1-007",
"objective": "107.1",
"type": "single",
"difficulty": 2,
"question": "Benutzer kommen teils aus `/etc/passwd`, teils aus LDAP. Welcher Befehl zeigt den Kontoeintrag von `anna` **unabhängig von der Quelle** an?",
"options": [
{ "id": "a", "text": "`getent passwd anna`", "correct": true, "explanation": "`getent` fragt die Datenbanken über NSS ab, also in der Reihenfolge aus `/etc/nsswitch.conf`." },
{ "id": "b", "text": "`grep anna /etc/passwd`", "correct": false, "explanation": "Findet nur lokale Einträge." },
{ "id": "c", "text": "`who anna`", "correct": false, "explanation": "`who` zeigt angemeldete Benutzer; ein Argument wird als Datei interpretiert." },
{ "id": "d", "text": "`last anna`", "correct": false, "explanation": "`last` zeigt die Anmeldehistorie aus `wtmp`." },
{ "id": "e", "text": "`cat /etc/nsswitch.conf`", "correct": false, "explanation": "Zeigt nur die Konfiguration der Quellen, keine Konten." }
],
"explanation": "Analog: `getent group`, `getent hosts`, `getent shadow` (als root).",
"references": ["man 1 getent", "man 5 nsswitch.conf"]
},
{
"id": "107.1-008",
"objective": "107.1",
"type": "multi",
"difficulty": 2,
"question": "Welche Aussagen zur Benutzer- und Gruppenverwaltung treffen zu?",
"options": [
{ "id": "a", "text": "`userdel -r anna` löscht auch das Home-Verzeichnis und das Mail-Spool von `anna`.", "correct": true, "explanation": "Ohne `-r` bleiben Home-Verzeichnis und Mail-Spool erhalten." },
{ "id": "b", "text": "Systemkonten haben üblicherweise UIDs unterhalb von `UID_MIN` aus `/etc/login.defs`.", "correct": true, "explanation": "Typisch: Systemkonten unter 1000, normale Benutzer ab 1000; `useradd -r` legt Systemkonten an." },
{ "id": "c", "text": "`groupdel` löscht eine Gruppe auch dann, wenn sie die primäre Gruppe eines Benutzers ist.", "correct": false, "explanation": "`groupdel` verweigert das; zuerst muss die primäre Gruppe des Benutzers geändert werden." },
{ "id": "d", "text": "Die UID 0 kann nur ein Konto mit dem Namen `root` haben.", "correct": false, "explanation": "Entscheidend ist die UID: Jedes Konto mit UID 0 hat Root-Rechte – ein Sicherheitsrisiko." },
{ "id": "e", "text": "`passwd` ohne Argument ändert immer das Passwort von root.", "correct": false, "explanation": "Ohne Argument ändert `passwd` das Passwort des aufrufenden Benutzers." }
],
"explanation": "Gruppen: `groupadd`, `groupmod -n neu alt` (umbenennen), `groupdel`. Mitgliedschaften prüfen: `id anna`, `groups anna`.",
"references": ["man 8 userdel", "man 5 login.defs"]
},
{
"id": "107.2-001",
"objective": "107.2",
"type": "single",
"difficulty": 1,
"question": "Wann läuft der Benutzer-crontab-Eintrag `30 2 * * 1 /usr/local/bin/backup.sh`?",
"options": [
{ "id": "a", "text": "Jeden Montag um 02:30 Uhr", "correct": true, "explanation": "Minute 30, Stunde 2, jeder Tag, jeder Monat, Wochentag 1 = Montag." },
{ "id": "b", "text": "Jeden Tag um 02:30 Uhr", "correct": false, "explanation": "Das wäre `30 2 * * *`." },
{ "id": "c", "text": "Am 1. jedes Monats um 02:30 Uhr", "correct": false, "explanation": "Das wäre `30 2 1 * *` (drittes Feld = Tag des Monats)." },
{ "id": "d", "text": "Im Januar täglich um 02:30 Uhr", "correct": false, "explanation": "Das wäre `30 2 * 1 *` (viertes Feld = Monat)." },
{ "id": "e", "text": "Montags alle 30 Minuten ab 02:00 Uhr", "correct": false, "explanation": "Das wäre z. B. `*/30 2-23 * * 1`." }
],
"explanation": "Felder: Minute · Stunde · Tag des Monats · Monat · Wochentag (0 und 7 = Sonntag) · Befehl.",
"references": ["man 5 crontab"]
},
{
"id": "107.2-002",
"objective": "107.2",
"type": "fill",
"difficulty": 1,
"question": "Mit welchem Befehl (mit Option) bearbeitet ein Benutzer seine eigene crontab?",
"answers": ["crontab -e"],
"explanation": "`crontab -e` öffnet den Editor und prüft beim Speichern die Syntax; `-l` listet, `-r` löscht. Die Dateien liegen unter `/var/spool/cron/`.",
"references": ["man 1 crontab"]
},
{
"id": "107.2-003",
"objective": "107.2",
"type": "single",
"difficulty": 2,
"question": "Worin unterscheidet sich ein Eintrag in `/etc/crontab` (bzw. `/etc/cron.d/*`) von einem Eintrag in einer Benutzer-crontab?",
"options": [
{ "id": "a", "text": "Vor dem Befehl steht zusätzlich ein Feld mit dem Benutzernamen, unter dem der Befehl läuft.", "correct": true, "explanation": "Aufbau systemweit: fünf Zeitfelder, Benutzer, Befehl – z. B. `17 * * * * root run-parts /etc/cron.hourly`." },
{ "id": "b", "text": "Es gibt kein Feld für den Wochentag.", "correct": false, "explanation": "Die fünf Zeitfelder sind identisch." },
{ "id": "c", "text": "Die Zeitangaben stehen in Sekunden statt in Minuten.", "correct": false, "explanation": "cron arbeitet mit Minuten als kleinster Einheit." },
{ "id": "d", "text": "Die Datei wird mit `crontab -e` bearbeitet.", "correct": false, "explanation": "`/etc/crontab` wird direkt mit einem Editor bearbeitet." },
{ "id": "e", "text": "Befehle laufen dort immer als root, ein Benutzerfeld gibt es nicht.", "correct": false, "explanation": "Gerade das Benutzerfeld ist der Unterschied." }
],
"explanation": "Daneben gibt es `/etc/cron.hourly`, `.daily`, `.weekly`, `.monthly` für Skripte ohne Zeitangabe.",
"references": ["man 5 crontab", "man 8 cron"]
},
{
"id": "107.2-004",
"objective": "107.2",
"type": "single",
"difficulty": 1,
"question": "Ein Befehl soll **einmalig** heute um 23:00 Uhr ausgeführt werden. Welches Werkzeug ist dafür gedacht?",
"options": [
{ "id": "a", "text": "`at 23:00`", "correct": true, "explanation": "`at` liest die Befehle von stdin und führt sie einmalig zur angegebenen Zeit aus." },
{ "id": "b", "text": "`batch 23:00`", "correct": false, "explanation": "`batch` führt Aufträge aus, sobald die Systemlast es zulässt; eine Uhrzeit nimmt es nicht an." },
{ "id": "c", "text": "`crontab -t 23:00`", "correct": false, "explanation": "`crontab` hat keine Option `-t`; cron ist für wiederkehrende Aufträge." },
{ "id": "d", "text": "`sleep 23:00`", "correct": false, "explanation": "`sleep` erwartet eine Dauer, keine Uhrzeit." },
{ "id": "e", "text": "`cron 23:00`", "correct": false, "explanation": "`cron` ist der Daemon und nimmt keine Aufträge auf der Befehlszeile an." }
],
"explanation": "`atq` listet anstehende at-Aufträge, `atrm` löscht sie. Zugriff steuern `/etc/at.allow` und `/etc/at.deny`. Mit systemd: `systemd-run --on-calendar=…`.",
"references": ["man 1 at"]
},
{
"id": "107.2-005",
"objective": "107.2",
"type": "multi",
"difficulty": 2,
"question": "Welche Dateien steuern, welche Benutzer `crontab` verwenden dürfen?",
"options": [
{ "id": "a", "text": "`/etc/cron.allow`", "correct": true, "explanation": "Existiert sie, dürfen nur die dort genannten Benutzer crontab nutzen." },
{ "id": "b", "text": "`/etc/cron.deny`", "correct": true, "explanation": "Existiert keine `cron.allow`, sind die hier genannten Benutzer ausgeschlossen." },
{ "id": "c", "text": "`/etc/at.deny`", "correct": false, "explanation": "Steuert nur den Zugriff auf `at`." },
{ "id": "d", "text": "`/etc/crontab`", "correct": false, "explanation": "Die systemweite crontab enthält Aufträge, keine Zugriffsregeln." },
{ "id": "e", "text": "`/etc/security/access.conf`", "correct": false, "explanation": "Regelt per PAM, wer sich wo anmelden darf." }
],
"explanation": "Fehlen beide Dateien, hängt das Verhalten von der Distribution ab (oft dürfen alle, teils nur root).",
"references": ["man 1 crontab"]
},
{
"id": "107.2-006",
"objective": "107.2",
"type": "single",
"difficulty": 1,
"question": "Welcher Befehl listet alle systemd-Timer mit ihrem nächsten und letzten Ausführungszeitpunkt auf?",
"options": [
{ "id": "a", "text": "`systemctl list-timers`", "correct": true, "explanation": "Mit `--all` auch inaktive Timer." },
{ "id": "b", "text": "`systemctl status cron`", "correct": false, "explanation": "Zeigt den Zustand des cron-Dienstes, nicht die systemd-Timer." },
{ "id": "c", "text": "`atq`", "correct": false, "explanation": "Listet at-Aufträge." },
{ "id": "d", "text": "`crontab -l`", "correct": false, "explanation": "Listet die crontab des aktuellen Benutzers." },
{ "id": "e", "text": "`journalctl --timers`", "correct": false, "explanation": "Eine solche Option gibt es nicht." }
],
"explanation": "Ein Timer (`name.timer`) startet die gleichnamige `name.service`-Unit; Zeitangaben z. B. `OnCalendar=daily` oder `OnBootSec=10min`.",
"references": ["man 5 systemd.timer"]
},
{
"id": "107.3-001",
"objective": "107.3",
"type": "single",
"difficulty": 1,
"question": "Mit welchem Befehl stellt man auf einem systemd-System die Zeitzone **dauerhaft** auf Europe/Berlin?",
"options": [
{ "id": "a", "text": "`timedatectl set-timezone Europe/Berlin`", "correct": true, "explanation": "Setzt den Link `/etc/localtime` auf `/usr/share/zoneinfo/Europe/Berlin`." },
{ "id": "b", "text": "`localectl set-timezone Europe/Berlin`", "correct": false, "explanation": "`localectl` verwaltet Locale und Tastaturbelegung, keine Zeitzone." },
{ "id": "c", "text": "`export TZ=Europe/Berlin`", "correct": false, "explanation": "Gilt nur für die aktuelle Shell und ihre Kindprozesse." },
{ "id": "d", "text": "`hwclock --timezone Europe/Berlin`", "correct": false, "explanation": "`hwclock` liest und stellt die Hardware-Uhr, eine Zeitzone setzt es nicht." },
{ "id": "e", "text": "`date --zone Europe/Berlin`", "correct": false, "explanation": "`date` hat keine solche Option; man kann nur per `TZ=… date` einmalig anzeigen." }
],
"explanation": "Ohne systemd: `/etc/localtime` von Hand verlinken bzw. unter Debian `/etc/timezone` und `dpkg-reconfigure tzdata`. Interaktiv hilft `tzselect`.",
"references": ["man 1 timedatectl", "man 8 tzselect"]
},
{
"id": "107.3-002",
"objective": "107.3",
"type": "single",
"difficulty": 2,
"question": "Welche Variable überschreibt **alle** anderen Locale-Einstellungen (`LANG` und alle `LC_*`)?",
"options": [
{ "id": "a", "text": "`LC_ALL`", "correct": true, "explanation": "`LC_ALL` hat Vorrang vor allen einzelnen `LC_*` und vor `LANG`." },
{ "id": "b", "text": "`LANG`", "correct": false, "explanation": "`LANG` ist der Standardwert mit der niedrigsten Priorität." },
{ "id": "c", "text": "`LC_MESSAGES`", "correct": false, "explanation": "Gilt nur für die Sprache von Programmmeldungen." },
{ "id": "d", "text": "`LC_CTYPE`", "correct": false, "explanation": "Gilt nur für Zeichenklassifizierung und Zeichensatz." },
{ "id": "e", "text": "`TZ`", "correct": false, "explanation": "`TZ` legt die Zeitzone fest, keine Locale." }
],
"explanation": "`locale` zeigt die wirksamen Werte, `locale -a` alle verfügbaren Locales. `LANG=C` bzw. `C.UTF-8` erzwingt neutrale Ausgaben, z. B. in Skripten.",
"references": ["man 7 locale"]
},
{
"id": "107.3-003",
"objective": "107.3",
"type": "fill",
"difficulty": 1,
"question": "Welches Programm konvertiert Textdateien zwischen Zeichenkodierungen, z. B. von ISO-8859-1 nach UTF-8? (nur der Befehlsname)",
"answers": ["iconv"],
"explanation": "Beispiel: `iconv -f ISO-8859-1 -t UTF-8 alt.txt > neu.txt`; `iconv -l` listet die bekannten Kodierungen.",
"references": ["man 1 iconv"]
},
{
"id": "107.3-004",
"objective": "107.3",
"type": "multi",
"difficulty": 2,
"question": "Welche Aussagen zu Zeichenkodierungen treffen zu?",
"options": [
{ "id": "a", "text": "UTF-8 kodiert Unicode-Zeichen mit variabler Länge (1 bis 4 Byte).", "correct": true, "explanation": "Häufige Zeichen sind kurz, seltene länger." },
{ "id": "b", "text": "ASCII-Zeichen haben in UTF-8 dieselben Byte-Werte wie in ASCII.", "correct": true, "explanation": "UTF-8 ist abwärtskompatibel zu 7-Bit-ASCII." },
{ "id": "c", "text": "ISO-8859-1 enthält das Euro-Zeichen.", "correct": false, "explanation": "Das Euro-Zeichen kam erst mit ISO-8859-15 (Latin-9)." },
{ "id": "d", "text": "UTF-8 benötigt für jedes Zeichen genau 2 Byte.", "correct": false, "explanation": "Feste 2 Byte entsprächen UCS-2; UTF-8 ist variabel." },
{ "id": "e", "text": "`LANG=C` aktiviert UTF-8 für alle Programme.", "correct": false, "explanation": "Die C/POSIX-Locale verwendet ASCII; für UTF-8 z. B. `C.UTF-8` oder `de_DE.UTF-8`." }
],
"explanation": "Im Objective genannt: UTF-8, ISO-8859, ASCII, Unicode sowie `locale`, `iconv`, `/etc/timezone`, `/etc/localtime`, `/usr/share/zoneinfo/`.",
"references": ["man 7 utf-8", "man 7 charsets"]
}
]
}