Protect a Python file and still make it executable

0

I'm writing a little Python program with a main.py and a packet called backend.

Now I want to protect the packet from accessing it but make it usable from the main.py with a normal user like AppUser without sudo and something like that.

How can I solve this problem?

MarvinMcFly

Posted 2018-03-26T05:57:46.867

Reputation: 64

Question was closed 2018-03-26T06:48:35.417

Thanks for the quick reply. It's close to my question but not realy the answere I'm searching not for encryption. I only want to protect on file, which is in the paket, with login data in it. Is there no solution from Linux like the user privilliges or something like that? – MarvinMcFly – 2018-03-26T06:38:45.140

In order to execute the file they need to be able to read it. The only way to do this would be to wrap up your backend as some kind of http server and put it on a secure machine, file permissions won't help here. – Mokubai – 2018-03-26T06:46:34.843

To be clear, you can probably create a new user that runs your backend and secure the backend under that user and block access to your file to all other users, but that would still require you to do programming work to make the backend accessible. We cannot know how your program works or if this is even workable for you. Programming questions are off topic here so we can't help you with that side of things. – Mokubai – 2018-03-26T08:08:41.687

No answers