Install of an agent on a Linux end point fails for a non-root user with a specific set of privileges.

Problem

Agent installation fails with the following error if the tty command is not added:
Bootstrap Failed for VM <VM ID> with error message:{ "status":"FAILED", "data":[ { "status":"FAILED", "message":"Failed - install - passwordless sudo access is required for the user <Install Username> on the command mkdir. [sudo: sorry, you must have a tty to run sudo]", "stage":"0" } ], "currentstage":"0", "totalstages":"0" }

The following are minimal necessary permissions of the user to install agents and should be mentioned in the sudoers file:

Solution

  • The following are minimal necessary permissions of the user to install agents and should be mentioned in the sudoers file. For example, for a user called telegrafinstall, you can find the sudoers file in the /etc/sudoers file or in the folder /etc/sudoers.d/:. Add these lines to /etc/sudoers, if you have not added them.
    Defaults:telegrafinstall !requiretty 
    
    Cmnd_Alias ARC_INSTALL_USER_COMMANDS=/usr/bin/cp*,/bin/cp*,/usr/bin/mkdir*,/bin/mkdir*,/usr/bin/chmod*,/bin/chmod*,/opt/vmware/ucp/bootstrap/uaf-bootstrap.sh,/opt/vmware/ucp/ucp-minion/bin/ucp-minion.sh 
    
    telegrafinstall ALL=(ALL)NOPASSWD: ARC_INSTALL_USER_COMMANDS