At our computer department we need to run a script with user rights wenn the user logs in. Adding the script to .config/autostart is not an option since the script must not be disabled by the user.
The Problem with for example the session-setup-script directive in lightdm.conf is that the script is run by root. We would therefore need to determine what users is currently trying to login and su to that user. That seems tricky since multiple users could already be logged in on the very same machine.
Is there a proper to way to do this?
Thanks in advance