KBEC-00061 - Changing the Commander server and agent user in Linux installations

Article ID:360033194691
2 minute readKnowledge base

Description

On Linux platforms, an ElectricCommander server installation has a server user and an agent user while a Commander agent-only install has an agent user only. These users own installation files and start Commander processes. For server installations, the server and agent user can be set to the same or different users. Users are normally set up during installation, but you may need to change the user sometime after installation. Use the following procedure to change a user.

ElectricCommander server installations - changing the ElectricCommander server and agent user

1. Stop all ElectricCommander services, use the following commands in this order:
  • /etc/init.d/commanderMySQLWrapper stop

  • /etc/init.d/commanderRepository stop

  • /etc/init.d/commanderApache stop

  • /etc/init.d/commanderAgent stop

  • /etc/init.d/commanderServer stop

2. Change the installation directory owner to the new server user:

chown \-hR :

For example, if the installation is in /opt/electriccloud, the new server user is serverUser and the new server group is serverGroup, use:

chown \-hR serverUser:serverGroup /opt/electriccloud

3. In /etc/init.d/commanderServer, change the RUN_AS_USER property to the new server user.

For example: RUN_AS_USER=serverUser

4. In /etc/init.d/commanderRepository, change the RUN_AS_USER property to the new server user.

For example: RUN_AS_USER=serverUser

5. In /etc/init.d/commanderMySQLWrapper, edit the line beginning with "setsid su" to contain the new server user name.

For example:

setsid su - serverUser \-c "/opt/electriccloud/electriccommander/mysql/commanderMySQL $*"

6. In /etc/init.d/commanderAgent, change the ACCOUNT property to the new agent user name.

For example:

ACCOUNT=agentUser

7. In the httpd.conf file located in the ElectricCommander install files in the apache/conf directory, change the User and Group to the new server user and group.

For example, if the installation is located in /opt/electriccloud/electriccommander, edit /opt/electriccloud/electriccommander/apache/conf/httpd.conf:

User serverUser
Group serverGroup

8. If the new agent user is different than the new server user, also change the following:
  • Change the ownership of agent.crt in the conf directory.
    -For example: chown agentUser:agentGroup /opt/electriccloud/electriccommander/conf/agent.crt * Change the ownership of agent.key in the conf directory.
    -For example: chown agentUser:agentGroup /opt/electriccloud/electriccommander/conf/agent.key * Change the ownership of the logs/agent directory (and its contents)
    -For example: chown \-hR agentUser:agentGroup /opt/electriccloud/electriccommander/logs/agent

9. Start all ElectricCommander services, use the following commands in this order:
  • /etc/init.d/commanderAgent start

  • /etc/init.d/commanderRepository start

  • /etc/init.d/commanderApache start

  • /etc/init.d/commanderMySQLWrapper start

  • /etc/init.d/commanderServer start

ElectricCommander agent-only installations - changing the ElectricCommander agent user

To change the agent user in an ElectricCommander agent-only installation, the easiest method is to uninstall and reinstall the agent with the new agent user and agent group names. Otherwise, the following procedure can be used:

1. Stop the ElectricCommander agent service, use the following command:

/etc/init.d/commanderAgent stop

2. Change the installation directory owner to the new agent user:

chown \-hR :

For example, if the installation is in /opt/electriccloud, the new agent user is agentUser and the new agent group is agentGroup, use:

chown \-hR agentUser:agentGroup /opt/electriccloud

3. In /etc/init.d/commanderAgent, change the ACCOUNT property to the new agent user name.

For example:

ACCOUNT=agentUser

4. Start all the ElectricCommander agent services, use the following command:

/etc/init.d/commanderAgent start