Our team is 3 people :
anna
ben
carl
They do web development so each site has its own user :
site1
is a user for website #1site2
is a user for website #2
We want each user to login with their user and be able to su
into the website's user so that files are created by the right "website" user.
Our twist is that every person must be able to su
into websites' users but not into people's users. So anna
can su
to site1
but she cannot su
to carl
.
Users (people) must be able to su
into future websites' users (e.g. site96
that does not exist yet). Note that people are pretty stable so it could be manageable to exclude instead of including.
When a website user is created, its group is the same as the user (user site1
is only member of group site1
). The server is managed by Runcloud, a service that generates the user and the group (same name for both).
I've seen articles like this which I think can help... but I get nowhere :
https://linuxize.com/post/how-to-add-user-to-sudoers-in-ubuntu/
How do I allow only one user to su to another account?
Is this achievable by doing the right configuration once (and not alter it each time we create a new website) ?
su
and no need to make the humans admins. this seems a classic use case for groups. Simply have the admin add each human to thesite1
group,site2
group, etc. Many possible variations both simple and complex. – user535733 Jan 31 '20 at 19:09su
orsudo
? – FedKad Jan 31 '20 at 19:52