admin_grundlagen:systemd_service_unit_files
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen der Seite angezeigt.
| Beide Seiten, vorherige ÜberarbeitungVorherige ÜberarbeitungNächste Überarbeitung | Vorherige Überarbeitung | ||
| admin_grundlagen:systemd_service_unit_files [2018/08/16 07:22] – ingo_wichmann | admin_grundlagen:systemd_service_unit_files [2025/09/02 13:23] (aktuell) – ingo_wichmann | ||
|---|---|---|---|
| Zeile 8: | Zeile 8: | ||
| ExecStart=/ | ExecStart=/ | ||
| </ | </ | ||
| + | |||
| + | (( | ||
| + | Lennart Poettering [[https:// | ||
| + | " | ||
| + | |||
| + | )) | ||
| Syntax des Unit Files prüfen: | Syntax des Unit Files prüfen: | ||
| Zeile 48: | Zeile 54: | ||
| systemctl enable nc | systemctl enable nc | ||
| + | |||
| + | Nach beendeter Verbindung neustarten: | ||
| + | |||
| + | <file txt / | ||
| + | … | ||
| + | |||
| + | [Service] | ||
| + | … | ||
| + | Restart=always | ||
| + | </ | ||
| ====== Beispiel für ein User Service Unit ====== | ====== Beispiel für ein User Service Unit ====== | ||
| Zeile 100: | Zeile 116: | ||
| VMDELAY=" | VMDELAY=" | ||
| VMLOGFILE="/ | VMLOGFILE="/ | ||
| + | </ | ||
| + | |||
| + | ====== Dienste absichern ====== | ||
| + | ((Lennart Poettering schreibt: // | ||
| + | should enable wherever we can. Specifically ProtectSystem=, | ||
| + | ProtectHome=, | ||
| + | ProtectedControlGroups=, | ||
| + | PrivateNetwork=, | ||
| + | RestrictNamespaces=, | ||
| + | |||
| + | TODO: noch nicht getestet | ||
| + | |||
| + | <file txt> | ||
| + | ProtectSystem=full | ||
| + | </ | ||
| + | oder | ||
| + | <file txt> | ||
| + | ProtectSystem=strict | ||
| + | ReadWritePaths=/ | ||
| + | ReadOnlyPaths=/ | ||
| + | CapabilityBoundingSet=~CAP_SYS_ADMIN | ||
| + | SystemCallFilter=~@mount, | ||
| + | </ | ||
| + | |||
| + | <file txt> | ||
| + | ProtectHome=true | ||
| + | ProtectKernelTunables=true | ||
| + | ProtectKernelModules=true | ||
| + | ProtectedControlGroups=true | ||
| + | PrivateTmp=true | ||
| + | PrivateDevices=true | ||
| + | SystemCallFilter=~@mount, | ||
| + | RestrictAddressFamilies=AF_UNIX, | ||
| + | RestrictNamespaces=true | ||
| + | RestrictRealtime=true | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | </ | ||
| + | |||
| + | Für lokale Dienste (systlog ohne netzwerk, cron (falls keine Jobs auf das Netzwerk zugreifen sollen), ...) zusätzlich: | ||
| + | <file txt> | ||
| + | PrivateNetwork=true | ||
| + | RestrictAddressFamilies=AF_UNIX | ||
| + | </ | ||
| + | |||
| + | TODO: Für Dienste, die keine Daten dauerhaft speichern (ntpd? unbound?): | ||
| + | <file txt> | ||
| + | DynamicUser=yes | ||
| + | User=unbound | ||
| + | Group=unbound | ||
| </ | </ | ||
admin_grundlagen/systemd_service_unit_files.1534404155.txt.gz · Zuletzt geändert: 2018/08/16 07:22 von ingo_wichmann
