admin_grundlagen:capabilities
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen der Seite angezeigt.
| Nächste Überarbeitung | Vorherige Überarbeitung | ||
| admin_grundlagen:capabilities [2013/10/08 21:03] – angelegt ingo_wichmann | admin_grundlagen:capabilities [2026/10/08 12:29] (aktuell) – ingo_wichmann | ||
|---|---|---|---|
| Zeile 1: | Zeile 1: | ||
| - | | + | Statt einem Programm über das SETUID-Bit |
| - | Unter Fedora 15 soll Capabilities | + | Mittels '' |
| - | https:// | + | |
| - | RHEL/CentOS 6 basiert auf Fedora 12 | + | |
| - | Problem: | + | ====== Backup ohne root: rsync soll alle Dateien lesen dürfen ====== |
| + | ===== remote ===== | ||
| + | cp / | ||
| + | setcap cap_dac_read_search+ep / | ||
| + | |||
| + | ===== local ===== | ||
| + | rsync --rsync-path=/ | ||
| + | |||
| + | |||
| + | |||
| + | ====== ping mit capability statt suid-Bit ====== | ||
| + | |||
| + | |||
| + | cat / | ||
| + | ./PING 9.9.9.9 | ||
| + | als root | ||
| + | setcap cap_net_raw=p ./PING | ||
| + | getcap ./PING | ||
| + | als user | ||
| + | ./PING 9.9.9.9 | ||
| Unter Debian nicht update-fest: | Unter Debian nicht update-fest: | ||
| - | http:// | + | * [[http:// |
| - | http:// | + | * [[http:// |
| + | |||
| + | |||
| + | Moderne Kernel :?: (oder eine andere black magick) erlauben '' | ||
| + | sysctl -a | grep ping | ||
| + | |||
| + | setcap cap_net_raw, | ||
| + | |||
| + | Danach kann jeder User tcpdump benutzen | ||
| + | |||
| + | |||
| + | ====== einer (root) shell eine Capability entziehen ====== | ||
| + | '' | ||
| + | |||
| + | capsh --drop=cap_chown, | ||
| + | chown kurt / | ||
| + | ping 9.9.9.9 | ||
| + | |||
| + | ====== Welcher Prozess hat welche Capabilities? | ||
| + | Pakete: libcap-ng-utils | ||
| + | pscap | ||
| + | getpcap < | ||
| + | |||
| + | == low level == | ||
| + | grep ^Cap / | ||
| + | |||
| + | CapInh: | ||
| + | CapPrm: | ||
| + | CapEff: | ||
| + | CapBnd: | ||
| + | CapAmb: | ||
| + | |||
| + | capsh --decode=000001ffffffdffe | ||
| + | |||
| + | ===== rsync read only ===== | ||
| + | zu sichernder Server: | ||
| + | |||
| + | apt install rsync acl libcap2-bin | ||
| + | useradd -r -d /srv/rosync -s /usr/bin/sh rosync | ||
| + | install -d -o rosync -g rosync -m 700 / | ||
| + | install -o rosync -g rosync -m 600 /dev/null /srv rosync/ | ||
| + | |||
| + | cp / | ||
| + | chown root:root / | ||
| + | chmod 700 / | ||
| + | setfacl -m user: | ||
| + | setcap cap_dac_read_search+ep / | ||
| + | |||
| + | |||
| + | TODO: include rrsync? | ||
| + | |||
| + | pull initierender Server: | ||
| + | apt install rsync | ||
| + | ssh-keygen -N '' | ||
| + | ssh root@otherserver 'cat > / | ||
| + | rsync -ax -e 'ssh -i .ssh/ | ||
| + | |||
| + | Was nicht gehen sollte: | ||
| + | rsync -ax -e 'ssh -i .ssh/ | ||
| + | |||
| + | ==== systemd + caps ==== | ||
| + | systemctl show < | ||
| + | ====== Doku ====== | ||
| + | * http:// | ||
| + | * [[http:// | ||
| - | Unter OpenSuSE nicht update-fest: | ||
| - | https:// | ||
admin_grundlagen/capabilities.1381266180.txt.gz · Zuletzt geändert: 2013/10/08 21:03 von ingo_wichmann
