brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: getcap -r / lists the programs that carry extra permissions

Permissions
~/tips/tip-permissions-getcap-recursive-audit

sudo getcap -r / 2>/dev/null

Lists all files on the system that have file capabilities set.

Besides the setuid bit, binaries can hold file capabilities, and those are easy to forget in an audit.

sudo getcap -r / 2>/dev/null

-r walks the tree and prints each file that has capabilities set, such as ping with cap_net_raw. Check for entries you did not add yourself, especially cap_setuid or cap_dac_override. The error redirect hides messages from /proc. Remove an entry with setcap -r FILE. Keep the output of a clean system and compare it later, the same way you would for setuid files. Reading the whole tree takes a while on large disks, so limit it with a path such as /usr when you are in a hurry.

Further reading: getcap manual page

More Permissions tips sudo su -s /bin/bash www-data sudo setfacl -R -d -m g:media:rwX /srv/media sudo cp -r /srv/site /srv/site.r ls -ln /srv/data newgrp media All Permissions tips (30) All topics

Link