Is there a good way in Linux to make an admin user with unlimited powers within a limited part of the filesystem tree?

I want to make a bunch of (automated, not real people) user accounts all in one folder and have a privileged script that can read all their data regardless of permissions. Ideally, I could shell in as this user to administrate, but just extending the privilege to a script would be fine.

Currently I only know how to do this by running the script as root. Is there a better way?

Follow

@urusan

Disclaimer : I am not sure if this is the right way to solve this,

You can add a user to the sudo group, this will allow users to run things as if they were root for example

sudo apt install <program>
you then enter your user password
<program> is installed

It is probably a better alternative to using su (or su -), which then needs you to give people the root password.

Sign in to participate in the conversation
CleverLibre Social

CleverLibre Social is an inclusive social instance for open discussion, learning, and community.
All cultures welcome.
Hate speech and harassment strictly forbidden.