0

I'm talking about files, not directories.

+r without +x : can't the user just copy the file elsewhere, and set its execution permission so they can run it?

+x without +r : can you really allow a user to execute something, without the user seeing the instructions? It seems it doesn't work.

1 Answer 1

2

+r without +x : can't the user just copy the file elsewhere, and set its execution permission so they can run it?

Yes, but they might not be able to reproduce the exact setup. For example on Debian, Wireshark includes /usr/bin/dumpcap, which is readable by everyone, but only executable by root and users in the wireshark group. Users can copy it elsewhere and make it executable, but (unless they’re root) they can’t bestow it with the additional permissions required to allow it to capture packets.

In other situations, some “executables” can be run without having the executable permission; for example, shell scripts can be given as an argument to sh, and run that way.

+x without +r : can you really allow a user to execute something, without the user seeing the instructions? It seems it doesn't work.

Yes, you can; try making an executable (non-script) executable-only, and running it — it will run fine.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.