Find all files a user can read from The 2019 Stack Overflow Developer Survey Results Are...
How to create dashed lines/arrows in Illustrator
Is domain driven design an anti-SQL pattern?
Where does the "burst of radiance" from Holy Weapon originate?
What does Linus Torvalds mean when he says that Git "never ever" tracks a file?
Is this food a bread or a loaf?
Should I write numbers in words or as numerals when there are multiple next to each other?
Carnot-Caratheodory metric
What is this 4-propeller plane?
What does "rabbited" mean/imply in this sentence?
Geography at the pixel level
What effect does the “loading” weapon property have in practical terms?
What does "sndry explns" mean in one of the Hitchhiker's guide books?
I looked up a future colleague on LinkedIn before I started a job. I told my colleague about it and he seemed surprised. Should I apologize?
Where to refill my bottle in India?
Is there a name of the flying bionic bird?
How to answer pointed "are you quitting" questioning when I don't want them to suspect
How to change the limits of integration
aging parents with no investments
What tool would a Roman-age civilization have to grind silver and other metals into dust?
How to reverse every other sublist of a list?
Which Sci-Fi work first showed weapon of galactic-scale mass destruction?
Does duplicating a spell with Wish count as casting that spell?
A poker game description that does not feel gimmicky
CiviEvent: Public link for events of a specific type
Find all files a user can read from
The 2019 Stack Overflow Developer Survey Results Are Inrecursively change file permission but not directories?POSIX find all local filesFind files that a user can not read?find command doesn't find (readable) files as non-root userhp-ux find command not working on a list of filesfind modified files recursively and copy with directory preserving directory structureHow to pass files found by find as arguments?How to find specific file types and tar them?find can't list all filesFind all files containing keywords
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}
At first, I wanted to simply use:
find /etc -type f -perm -004
And it did work. But then there were two files from which a current user could not read, but a group this user was in could access it anyway. So it didn't work properly.
I think this problem is solvable by writing a small script and iterating over each group. But is there a simpler way around it?
find
New contributor
add a comment |
At first, I wanted to simply use:
find /etc -type f -perm -004
And it did work. But then there were two files from which a current user could not read, but a group this user was in could access it anyway. So it didn't work properly.
I think this problem is solvable by writing a small script and iterating over each group. But is there a simpler way around it?
find
New contributor
add a comment |
At first, I wanted to simply use:
find /etc -type f -perm -004
And it did work. But then there were two files from which a current user could not read, but a group this user was in could access it anyway. So it didn't work properly.
I think this problem is solvable by writing a small script and iterating over each group. But is there a simpler way around it?
find
New contributor
At first, I wanted to simply use:
find /etc -type f -perm -004
And it did work. But then there were two files from which a current user could not read, but a group this user was in could access it anyway. So it didn't work properly.
I think this problem is solvable by writing a small script and iterating over each group. But is there a simpler way around it?
find
find
New contributor
New contributor
New contributor
asked yesterday
RowanStoneRowanStone
82
82
New contributor
New contributor
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Try:
find /etc -type f -readable
From man find
:
-readable
Matches files which are readable. This takes into account access control lists and other permissions artifacts which the
-perm test ignores. This test makes use of the access(2) system call, and so can be fooled by NFS servers which do
UID mapping (or root-squashing), since many systems implement
access(2) in the client's kernel and so cannot make use
of the UID mapping information held on the server.
Limitation: This won't find readable files if they are under a directory that is not readable. (Hat tip roaima.)
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
RowanStone is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f511324%2ffind-all-files-a-user-can-read-from%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Try:
find /etc -type f -readable
From man find
:
-readable
Matches files which are readable. This takes into account access control lists and other permissions artifacts which the
-perm test ignores. This test makes use of the access(2) system call, and so can be fooled by NFS servers which do
UID mapping (or root-squashing), since many systems implement
access(2) in the client's kernel and so cannot make use
of the UID mapping information held on the server.
Limitation: This won't find readable files if they are under a directory that is not readable. (Hat tip roaima.)
add a comment |
Try:
find /etc -type f -readable
From man find
:
-readable
Matches files which are readable. This takes into account access control lists and other permissions artifacts which the
-perm test ignores. This test makes use of the access(2) system call, and so can be fooled by NFS servers which do
UID mapping (or root-squashing), since many systems implement
access(2) in the client's kernel and so cannot make use
of the UID mapping information held on the server.
Limitation: This won't find readable files if they are under a directory that is not readable. (Hat tip roaima.)
add a comment |
Try:
find /etc -type f -readable
From man find
:
-readable
Matches files which are readable. This takes into account access control lists and other permissions artifacts which the
-perm test ignores. This test makes use of the access(2) system call, and so can be fooled by NFS servers which do
UID mapping (or root-squashing), since many systems implement
access(2) in the client's kernel and so cannot make use
of the UID mapping information held on the server.
Limitation: This won't find readable files if they are under a directory that is not readable. (Hat tip roaima.)
Try:
find /etc -type f -readable
From man find
:
-readable
Matches files which are readable. This takes into account access control lists and other permissions artifacts which the
-perm test ignores. This test makes use of the access(2) system call, and so can be fooled by NFS servers which do
UID mapping (or root-squashing), since many systems implement
access(2) in the client's kernel and so cannot make use
of the UID mapping information held on the server.
Limitation: This won't find readable files if they are under a directory that is not readable. (Hat tip roaima.)
edited yesterday
answered yesterday
John1024John1024
48.5k5113128
48.5k5113128
add a comment |
add a comment |
RowanStone is a new contributor. Be nice, and check out our Code of Conduct.
RowanStone is a new contributor. Be nice, and check out our Code of Conduct.
RowanStone is a new contributor. Be nice, and check out our Code of Conduct.
RowanStone is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f511324%2ffind-all-files-a-user-can-read-from%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown