Enabling SSH on a VMware vSphere Host

To pull NVIDIA GPU-related metrics, the eG agent should be allowed SSH access to the vSphere host.

Typically, SSH access is allowed only for privileged users. However, high-security environments may prefer not to allow SSH access to privileged users, as this would give such users direct access to the command prompt. Alternatively therefore, administrators of such environments can do the following.

  1. Enable restricted SSH access to a non-privileged user

  2. Configure the eG agent with the credentials of this non-privileged user

The detailed steps to achieve the above are discussed below:

  1. Login to the target vSphere host as a root user.

  2. Identify the non-privileged user for whom you want to allow SSH access. This can be an existing user or a new user created for monitoring purposes.

  3. Then, edit the sshd_config file in the /etc/ssh/ directory.

  4. Append an entry of the following format in the file:

    Match user <name_of_non-privileged_user>

    ForceCommand nvidia-smi -q

    For instance, if the non-privileged user who should be allowed SSH access is john, you specification should be:

    Match user john

    ForceCommand nvidia-smi -q

  5. This entry will allow SSH access to the non-privileged user, so that he/she can directly access the command prompt, and issue the nvidia-smi -q command alone at the prompt. Once the command is successfully executed, the user automatically exits the vSphere host.

  6. Finally, save the file and restart the SSH service on the host.

  7. Next, proceed to configure the eG agent monitoring the vSphere server with the credentials of the non-privileged user you specified in the sshd_config file. For that, configure the CONSOLE USER and CONSOLE PASSWORD parameters of the Grid GPUs - ESX test with the user name and password (respectively) of that non-root user. Confirm the password by retyping it in the CONFIRM PASSWORD text box. Save the test configuration.