Score:0

Is there a tool to check and manage file permissions?

cn flag

I developed a set of rules for file and directory owner and permissions for our company server. E.g.:

Projects/: permission 750, owner root, group internal
Projects/* (directories): permission 2770, group internal
Projects/*/* (files): permission 644, group internal
Projects/*/* (directories): permission 2770, group internal
Office/: permission 2770, owner root, group internal
...

I started to write a script for checking these rules. But this became really uncomfortable. An option for automatic correction would be also nice. I already discovered systemd-tmpfiles which does a similar job but (imho) lacks of reporting feature. I don't know if it will support the wildcards, too. Defining some exclusions rules would also be nice.

Does someone know if there's maybe a solution for that? I already searched for linux file system permission services, but the results were really misleading.

in flag
Software recommendations are off topic. But every configuration management tool is able to do that.
Score:0
jp flag

You need mtree.

The utility mtree compares the file hierarchy rooted in the current directory against a specification read from the standard input.

user10070149 avatar
cn flag
Hello! Thank you for that hint. Despite that there seems to be really less documentation I checked some features. The following guide helped me a lot: https://forums.freebsd.org/threads/small-guide-on-using-mtree.61113/ But I think mtree does not cover my use case of checking all directories (and files) recursively. E.g.: find -type d -not \( -perm 2770 -and -group office \). This would also check all sub-directories.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.