3

If you expressly list the directories, parent first, you can achieve your stated aim of creating the directories in one command: mkdir -m 555 -p a a/b a/b/c With shells with support for csh-style brace expansion such as bash you can simplify this a little at the expense of readability: mkdir -m 555 -p a{,/b{,/c}} Notice, however, that for permissions 555 ...


2

So I am guessing that the read permission for others is making the copying possible? Copying a file is just reading the file contents, creating a new file, and writing the data there. You need permission to read the original file, and write permission to the directory of the new file to be able to create it. See Execute vs Read bit. How do directory ...


2

Fundamental metaphor: Directories are not Folders The fundamental concept to understand is the concept of a directory. This is important: Unix does not have folders, it has directories. This distinction is important: a folder contains things. A directory lists things. If you think of folders, you have the wrong metaphor stuck in your head. Think of the ...


2

As mentioned by Artem, apache or php-fpm may be running as a systemd service with PrivateTmp=true mentioned here https://www.freedesktop.org/software/systemd/man/systemd.exec.html That would result in the web server running in its own mount namespace with a different /tmp and /var/tmp to the rest of the system. Assuming this is the problem you can use ...


2

Without more debugging¹, it's impossible to know for sure, but this sure looks like the stat/stat64 problem Linux had² (and still has). Basically, there's the fstat syscall used to query things like "is this file a directory?" (which is very important to know if you're trying to recursively delete things), "is it a symlink?", "What's ...


2

You don't need to do anything special to the program: root can run programs as any user they want using e.g. su or sudo, as you demonstrate. But then that user needs to execute thee program. Hence, what you want is impossible, making a program be executed by another user, but not allowing that user to execute thee program. Your whole "change the ...


2

It does look like mkdir doesn't apply the mode set by -m when it creates the intermediary directories. But, at least in most cases, you can use the umask to modify the permissions it sets for them. The umask works by clearing the permission bits that are set in the umask, so if you want the intermediaries to have e.g. the permissions 0700, set umask to 0077. ...


1

chroot is exactly meant for that. You just mount the entries from the target's /etc/fstab into their target directories as needed, mount -t bind in /proc and /sys, and then just chroot /target. The one thing that's totally useless, though, is anyone's password.


1

The simplest cause is that the entire /run/user/<UID> directory does not exist – it hasn't been created by systemd-logind, typically because the UID in question hasn't gone through the standard "user login" procedures, but was merely su'd or sudo'd to, without invoking pam_systemd. ("Permission denied" comes from dconf's attempting ...


1

(Some) file systems have a feature to reserve a percentage of space for root usage. This seems to be exactly what's happening here. The things you deleted don't seem to suffice to lift the available space percentage over that threshold. Assuming this is ext4, 'man tune2fs' would be the right tool to use to adjust the percentage. For other file systems, other ...


1

The answer Marcus linked explains very well how directory permissions work. To answer the "How" for your specific case - as long as the log file you want everyone accessing itself has the correct permissions to indeed allow read-only or read-write access to itself, you can create a hardlink to the file in a central location accessible by those ...


1

Following @Panki's advice This is not a problem with permissions, you are on the wrong track. Your entire filesystem is read only. I found out that I was really on the wrong track, However, The solution to this problem turned out to be a lot more simple than I thought. Took a different approach and came to know that Windows 10 (on dual-boot) can enable ...


Only top voted, non community-wiki answers of a minimum length are eligible