Score:-1

virtual environment and/or acl?

cn flag

I was wondering if there is another method from access control on a folder to execute a file. I thought of something like a password protected virtual environment and only when accessing the virtual environment can one execute the files inside the folder(s). Or is there a simple acl method?

kegdeg avatar
cn flag
and also something like the folders/files are only visible after activating the virtual environment? so if the environment is not activated the files/folders just don't appear to be there (hidden)
Score:0
ec flag

Assuming you are referring to a Python virtual environment: this has nothing to do with access control. A Python venv just tweaks a bunch of settings in the current shell so the Python environment and interpreter is independent of the system-wide settings and modules. All files / directories in a Python venv can be access based on the set permissions (and ACL if used / set).

So you could use ACL or, as an alternative, assign the folder and everything included to a new group and then make the files accessible / executable only for the group.

What is the better way depends on what you want to achieve in the end. Probably you could go more in details of the final goal?

kegdeg avatar
cn flag
thanks, the goal is to keep a folder hidden with all its content, and after a certain command the directory 'appears' with all its files, without having to gpg encrypt-decrypt the direcorty, yet still using some sort of authentication to make the directory visible and accesible
noisefloor avatar
ec flag
Well, neither Linux permissions nor ACL are designed for that. Even when protecting a directory (and its subdirectories) this way, the top directory will be visible. Although unprivileged users will not be able to access it. I'm not sure there any tool which is capable of doing what you intend to do. A possible way which may work is to put the files on a different drive and only mount it on-demand. However, I'm not sure how detailed you can assign mount privileges so only an assigned group of users can perform a mount.
I sit in a Tesla and translated this thread with Ai:

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.