Is it possible to limit access to a file by a program.
The problem I have is that users run a program under their UID and it accesses a file. I want that file not to be accessible to them through file-system.
The program is java -jar myProgram.jar filePathAsParameter
Thank you
chown user:group file ; chmod 700 file
( sudo chown $USER:$USER /path/to/file ; sudo chmod 700 /path/to/file; ) – Yunus Jul 13 '16 at 23:53setuid
on the java file to run the program as another user who has access to the file. – ojs Jul 14 '16 at 00:09setgid
for that control. This is how, for example, games are usually configured to protect access to the top scores file. – MAP Jul 14 '16 at 00:54setgid
(there's no git involved :-). Depending on details which I don't know that may require a shim.setgid
is just likesetuid
except it uses group permissions. I swear I just wrote this answer somewhere yesterday. – MAP Jul 14 '16 at 01:39