Managing multiple users with access to environments for administration over time is really a challenge.
The best way I've found so far to solve this, easy to maintain and control, was using Guacamole (
https://guacamole.apache.org/) as a remote connection gateway for SSH.
In the case of iDempiere, we can have the following configuration:
-> In the Linux instance, I configure the users who need to run the services following the best practices of each system (idempiere user, postgres user, root user, etc);
-> For each of them I create an SSH key and configure it so that they can execute privileged commands with sudo without password (command + exact arguments). For example, to stop idempiere service, user idempiere can run "sudo systemctl start idempiere" without asking for password;
-> In Guacamole I create different connections, one for each OS/LINUX user used in the instance, always using the private keys created for each user to authenticate the session;
-> In Guacamole I create the users that will connect (support agents, developers, and others), and I assign the necessary connections for each one to perform their work, for example:
* Murilo has full access, so it only assigns him the connection to the root user created earlier;
* Chuck can access the server with OS/LINUX users idempiere and postgresql, so I assign him the two connections created earlier for each of these users;
In this way, whenever I have a new collaborator who needs to access the instance with one of these users, I create a new user inside Guacamole and assign the necessary connections to the work he will perform.
Through Guacamole's functionalities, I can adjust simultaneous connection limits settings, information about users connected to instances, connection history and session recording (history of commands executed by user), session persistence, file transfer control and other functionalities. very interesting.
In addition, I can close all the ports on the servers so that they are only accessible through the Guacamole terminal, increasing security.
I don't know if I managed to convey exactly the idea of how to use the tool, and if it can help you solve your scenario, but it's an approach that worked very well here so I wanted to share.