L
L
Leonid2021-11-09 14:34:27
linux
Leonid, 2021-11-09 14:34:27

How to control access to files in Linux with your own program?

Hello, I want to write a program for additional authentication to some folders in Linux. For example, by putting protection on a folder, in order to open it, you need to follow the link generated by the program and go through the captcha / enter a password / something else. But I don’t quite understand what I need to use so that Linux itself does not let it into the folder, but transfers control to the program and waits for authorization to occur, and then, if everything is ok, then let it into the folder. I also found that Linux PAM might be suitable for this, is it so?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
SOTVM, 2021-11-10
@sotvm

another inventor of bicycles)))
everything you need and not even need, everything is in the system = learn to live / use it

A
AlexVWill, 2021-11-09
@AlexVWill

It seems to me that without a change in the core, this will be fully implemented in a difficult way. Because the implementation of file access is at the kernel level, and any applications still work at the application level (even with root access, which in practice is best avoided). Therefore, the system, providing access to files for the operation of one application, will also implement access to another application, such as a file manager, in the same way. At the application level, of course, you can write an encryption program that will encrypt files, but in any case, all users who have the appropriate rights will have access to them, regardless of the application. Another option is to write essentially an access manager shell that will use system tools to manage access inside some kind of sandbox, but I understand that this is not necessary,

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question