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: namei -l shows the permissions of every folder on the way to a file

Permissions
~/tips/tip-permissions-namei-l-path-permissions

namei -l /var/www/html/uploads/photo.jpg

Prints the owner and mode of each folder in a path to find where access stops.

“Permission denied” on a file whose own mode looks fine is usually a parent folder that blocks the way.

namei -l /var/www/html/uploads/photo.jpg

namei follows the path one component at a time and prints the owner, group and mode of each, symlinks included. The first line without x for your user is the culprit. Run it as the user that gets the error, or with sudo -u. It is in util-linux, so it is already installed on Debian and Ubuntu. Add -x to mark mount points with a D instead of a d.

Further reading: namei 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