I'm starting with Python 3, using Raspbian (from Debian), and using virtualenv. I understand how to create/use a virtualenv to "sandbox" different Python project, HOWEVER I'm a bit unclear on whether one should be setting up a different linux user for each project (assuming that the project/virtualenv will be used to create & then run a daemon process on the linux box).
So when creating separate python environments the question I think is should I be:
creating a new linux user account for each deamon/acript I'm working on, so that both the python virtual environment, and the python project code area can live under directories owned by this user?
perhaps just create one new non-administrator account at the beginning, and then just use this account for each project/virtual environmnet
create everything under the initial admin user I first log with for raspbian (e.g. "pi" user) - Assume NO for this option, but putting it in for completeness.
TL;DR: 1. no 2. yes 3. no
- creating a new linux user account for each deamon/script I'm working on, so that both the python virtual environment, and the python project code area can live under directories owned by this user?
No. Unnecessary complexity and no real benefit to create many user accounts for this. Note that one user can be logged in multiple sessions and running multiple processes.
- perhaps just create one new non-administrator account at the beginning, and then just use this account for each project/virtual environment
Yes, and use sudo
from the non-admin account if/when you need to escalate privilege.
- create everything under the initial admin user I first log with for raspbian (e.g. "pi" user) - Assume NO for this option, but putting it in for completeness.
No. Better to create a regular user, not run everything as root. Using a non-root administrator account would be OK, though.