Back openDesk Edu for a sovereign, open-source education — every vote counts.
Vote nowSave products you love by clicking the heart icon.
Complete guide to the LPI DevOps Tools Engineer certification (701-100): exam objectives, study resources, and how it relates to traditional LPI certifications.
Master LPIC-1 102-500: shell scripting, user management, networking fundamentals, system security, and administrative tasks with detailed command examples.
Die Prüfung LPIC-3 303: Security umfasst Kryptografie, Public-Key-Infrastruktur, Datei- und Netzwerksicherheit, PAM, SSH-Hardening, Zugriffskontrollsysteme (SELinux/AppArmor) und System-Auditing. Dieser Leitfaden bietet einen tiefen Einblick auf Befehlsebene in jedes dieser Ziele.
| Typ | Schlüsselverwendung | Algorithmen | Performance |
|---|---|---|---|
| Symmetrisch | Gleicher Schlüssel für Verschlüsselung/Entschlüsselung | AES, ChaCha20, Twofish | Schnell, geeignet für große Datenmengen |
| Asymmetrisch | Public/Private-Key-Paar | RSA, ECDSA, Ed25519 | Langsam, genutzt für Schlüsselaustausch und Signaturen |
| Hybrid | Symmetrischer Schlüssel asymmetrisch verschlüsselt | TLS, SSH, OpenPGP | Praktische Kombination |
openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:4096 -out private.key
# Generate an ECDSA key (NIST P-256)
openssl genpkey -algorithm EC -pkeyopt ec_paramgen_curve:prime256v1 -out ecdsa.key
# Generate a self-signed certificate
openssl req -x509 -new -nodes -key private.key -sha256 -days 365 \
-subj "/C=DE/ST=Berlin/L=Berlin/O=Example/CN=server.example.com" \
-out cert.pem
# View certificate details
openssl x509 -in cert.pem -text -noout
# Generate a CSR
openssl req -new -key private.key -out request.csr \
-subj "/CN=server.example.com"
# Encrypt a file with AES-256
openssl enc -aes-256-cbc -salt -in plain.txt -out encrypted.enc
# Decrypt a file
openssl enc -d -aes-256-cbc -in encrypted.enc -out plain.txt
# Create the CA directory structure
mkdir -p ca/{certs,crl,newcerts,private,requests}
chmod 700 ca/private
echo 1000 > ca/serial
touch ca/index.txt
# Configure openssl-ca.cnf
[ ca ]
default_ca = CA_default
[ CA_default ]
database = ca/index.txt
serial = ca/serial
private_key = ca/private/ca.key.pem
certificate = ca/certs/ca.cert.pem
default_days = 365
default_md = sha256
policy = policy_strict
[ policy_strict ]
countryName = match
stateOrProvinceName = match
organizationName = match
organizationalUnitName = optional
commonName = supplied
emailAddress = optional
# Generate CA key and self-signed certificate
openssl genpkey -algorithm RSA -out ca/private/ca.key.pem -pkeyopt rsa_keygen_bits:4096
openssl req -x509 -new -key ca/private/ca.key.pem -out ca/certs/ca.cert.pem \
-days 3650 -subj "/C=DE/O=Example CA/CN=Example Root CA"
# Sign a server CSR
openssl ca -config openssl-ca.cnf -in server.csr -out server.crt
# Revoke a certificate
openssl ca -config openssl-ca.cnf -revoke server.crt
# Generate CRL
openssl ca -config openssl-ca.cnf -gencrl -out ca/crl/ca.crl.pem
# Verify CRL
openssl crl -in ca/crl/ca.crl.pem -text -noout
# Verify certificate chain
openssl verify -CAfile ca.cert.pem -untrusted intermediate.cert.pem server.crt
# Check if certificate is revoked (with CRL)
openssl verify -CAfile ca.cert.pem -CRLfile ca.crl.pem server.crt
# ACLs anzeigen
getfacl /path/to/file
# ACL setzen: Benutzer Lese-/Schreibrechte gewähren
setfacl -m u:jdoe:rw /path/to/file
# ACL setzen: Gruppe Lese-/Ausführungsrechte gewähren
setfacl -m g:developers:rx /path/to/dir
# Spezifischen ACL-Eintrag entfernen
setfacl -x u:jdoe /path/to/file
# Standard-ACL für Verzeichnis setzen (wird von neuen Dateien geerbt)
setfacl -d -m g:developers:rx /path/to/dir
setfacl -R -m g:developers:rx /path/to/dir
getfacl -R /path > acls.backup setfacl --restore=acls.backup
### Extended Attributes (xattrs)
```bash
# Erweitertes Attribut setzen
setfattr -n user.comment -v "Important document" file.txt
# Erweiterte Attribute anzeigen
getfattr -d file.txt
# Erweitertes Attribut entfernen
setfattr -x user.comment file.txt
# Attribute auflisten (zeigt nur Attributnamen)
attr -l file.txt
# Sicherheitsbezogene erweiterte Attribute (SELinux-Kontext)
getfattr -n security.selinux file.txt
# Datei unveränderlich machen (selbst root kann sie nicht ändern)
chattr +i /etc/hosts
# Append-only-Modus (für Log-Dateien)
chattr +a /var/log/auth.log
# Flags anzeigen
lsattr /etc/hosts
# Unveränderlich-Flag entfernen
chattr -i /etc/hosts
# Ruleset-Datei erstellen: /etc/nftables.conf
table inet filter {
chain input {
type filter hook input priority 0; policy drop;
ct state established,related accept
ct state invalid drop
iif "lo" accept
ip protocol icmp accept
tcp dport 22 counter accept
tcp dport 80 counter accept
tcp dport 443 counter accept
}
chain forward {
type filter hook forward priority 0; policy drop;
}
chain output {
type filter hook output priority 0; policy accept;
}
}
# Ruleset anwenden
nft -f /etc/nftables.conf
# Regeln auflisten
nft list ruleset
# Temporäre Regel hinzufügen
nft add rule inet filter input tcp dport 8080 accept
# Regel löschen (zuerst Handle abrufen)
nft -a list ruleset
nft delete rule inet filter input handle 3
# /etc/fail2ban/jail.local
[sshd]
enabled = true
port = ssh
filter = sshd
logpath = /var/log/auth.log
maxretry = 5
bantime = 3600
findtime = 600
# Benutzerdefinierter Filter: /etc/fail2ban/filter.d/nginx-botsearch.conf
[Definition]
failregex = ^<HOST> - -.*GET.*(?:/wp-admin|/admin|/\.env).*HTTP
ignoreregex =
# Jails verwalten
fail2ban-client status
fail2ban-client status sshd
fail2ban-client set sshd unbanip 10.0.0.5
| Module Type | Purpose |
|---|---|
| auth | Verify user identity (password, biometric, 2FA) |
| account | Check account validity (expiration, time of day) |
| session | Set up session environment (mount home, log audit) |
| password | Update authentication tokens (password change) |
# /etc/pam.d/common-auth
auth [success=2 default=ignore] pam_unix.so nullok_secure
auth [success=1 default=ignore] pam_ldap.so use_first_pass
auth requisite pam_deny.so
auth required pam_permit.so
# /etc/pam.d/common-password
password requisite pam_pwquality.so retry=3 minlen=12
password [success=1 default=ignore] pam_unix.so obscure use_authtok sha512
password requisite pam_deny.so
password required pam_permit.so
# /etc/pam.d/common-session
session required pam_env.so
session required pam_unix.so
session optional pam_ldap.so
session optional pam_systemd.so
| Flag | Behavior |
|---|---|
| required | Must succeed; continues checking other modules regardless |
| requisite | Must succeed; stops immediately on failure |
| sufficient | If succeeds, skips remaining auth modules |
| optional | Result matters only if this is the only module |
| include | Include entire configuration from another file |
| substack | Like include but success/failure scoped to the substack |
# Installation
apt-get install libpam-google-authenticator
# Benutzer konfigurieren
google-authenticator
# /etc/pam.d/sshd
auth required pam_google_authenticator.so
auth required pam_unix.so
# /etc/ssh/sshd_config
ChallengeResponseAuthentication yes
AuthenticationMethods publickey,keyboard-interactive
# Kryptografie
HostKey /etc/ssh/ssh_host_ed25519_key
HostKey /etc/ssh/ssh_host_rsa_key
KexAlgorithms sntrup761x25519-sha512@openssh.com,diffie-hellman-group16-sha512
Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com
MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com
# Authentifizierung
PubkeyAuthentication yes
PasswordAuthentication no
ChallengeResponseAuthentication no
AuthenticationMethods publickey
PermitRootLogin prohibit-password
MaxAuthTries 3
LoginGraceTime 30
# Session
ClientAliveInterval 300
ClientAliveCountMax 2
MaxSessions 10
AllowUsers jdoe admin
# Forwarding
X11Forwarding no
AllowTcpForwarding no
AllowAgentForwarding no
# Ed25519-Key generieren (empfohlen)
ssh-keygen -t ed25519 -a 100 -f ~/.ssh/id_ed25519
# RSA-Key generieren (für Legacy-Systeme)
ssh-keygen -t rsa -b 4096 -a 100 -f ~/.ssh/id_rsa
# Public Key auf den Host kopieren
ssh-copy-id -i ~/.ssh/id_ed25519.pub user@host
# SSH-Agent für Key-Forwarding verwenden
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519
ssh -A user@host
# SSH-Tunnel (lokales Port-Forwarding)
ssh -L 8080:internal-web:80 user@bastion
# SSH-Tunnel (remote Port-Forwarding)
ssh -R 9090:localhost:3000 user@public-host
# Aktuellen Modus prüfen
getenforce
# Modus und Policy prüfen
sestatus
# Modus temporär ändern
setenforce 0 # Permissive
setenforce 1 # Enforcing
# Modus dauerhaft ändern
# /etc/selinux/config
SELINUX=enforcing
SELINUXTYPE=targeted
# Datei-Kontext anzeigen
ls -Z /var/www/html/index.html
# Prozess-Kontext anzeigen
ps -eZ | grep httpd
# Datei-Kontext ändern
chcon -t httpd_sys_content_t /var/www/html/index.html
# Standard-Kontext wiederherstellen
restorecon -Rv /var/www/html/
# Kontexte basierend auf Policy-Spezifikation anwenden
setfiles /etc/selinux/targeted/contexts/files/file_contexts /var/www
# Datei-Kontext persistent setzen (für Relabeling)
semanage fcontext -a -t httpd_sys_content_t "/web(/.*)?"
restorecon -Rv /web
# Booleans auflisten
getsebool -a
# Spezifischen Boolean prüfen
getsebool httpd_can_network_connect
# Boolean setzen (temporär)
setsebool httpd_can_network_connect on
# Boolean setzen (permanent)
setsebool -P httpd_can_network_connect on
# Denials anzeigen
grep AVC /var/log/audit/audit.log
# Mit sealert analysieren
sealert -a /var/log/audit/audit.log
# Policy-Modul für eine benutzerdefinierte Anwendung erstellen
audit2allow -a -M myapp
semodule -i myapp.pp
# AppArmor-Status prüfen
apparmor_status
# Profil-Modus setzen
aa-enforce /path/to/profile # Enforcing
aa-complain /path/to/profile # Nur Logging
# Profil für ein Binary generieren
aa-genprof /usr/bin/myapp
# Profil basierend auf Logs aktualisieren
aa-logprof
# Benutzerdefiniertes Profil: /etc/apparmor.d/usr.bin.myapp
#include <tunables/global>
/usr/bin/myapp {
#include <abstractions/base>
/etc/myapp/config r,
/var/lib/myapp/** rw,
/tmp/myapp-* rw,
network inet tcp,
}
# Installieren und starten
apt-get install auditd audispd-plugins
# Audit-Regel hinzufügen
auditctl -w /etc/passwd -p wa -k passwd_changes
auditctl -w /etc/shadow -p wa -k shadow_changes
auditctl -a exit,always -S execve -F uid!>=1000 -k user_commands
# Regeln auflisten
auditctl -l
# Audit-Log durchsuchen
ausearch -k passwd_changes
ausearch -ts today -k user_commands
# Bericht generieren
aureport -l # Login-Bericht
aureport -x # Befehlsausführungs-Bericht
aureport -k # Keyed-Event-Bericht
# Regeln persistent machen
# /etc/audit/rules.d/audit.rules
Bereit, dieses Wissen auf die Probe zu stellen? Die interaktive LPI-Übungsplattform auf courses.graphwiz.ai enthält über 400 realistische Fragen zu den Zertifizierungen LPIC-1, LPIC-2, LPIC-3 und DevOps Tools Engineer — inklusive Lernmodus, zeitgesteuerten Prüfungen, Domain-Aufschlüsselungen, Schwachstellenanalysen und Spaced-Repetition-Flashcards. Jetzt auf courses.graphwiz.ai üben →