To enable this you will need to add the account you will be using to install the agent to the sudo users. In our case we are going to add the Oracle Enterprise Manager agent to a hadoop node which has a user named hadoopnode0 under which the agent will be deployed. To be able to install the agent with this user we define a named credential in Oracle Enterprise Manager and state that it needs to execute its commands as the user root.
Before we continu we have to be sure that the user hadoopnode0 is added to the sudoers. For this you will have to edit the file /etc/sudoers and make some changes. Remember that this example is quite a quick and dirty example to get the agent on the host, in a large scale deployment you might want to consider an other strategie with specific usernames and specific sudo rights to it.
First change the following line so it is commented out:
Next tho this we have to enable the option for visiblepw. This is by default disabled so we need to make sure it is enabled. Considering you have a fresh install change the following line:
Now add the user that you will be using to the file. In our case this is hadoopnode0 and we add a line for this user directly under the line for the root account.
root ALL=(ALL) ALL hadoopnode0 ALL=(ALL) ALL
After changing those settings you should be able to use the agent deployment options on the host in Oracle Enterprise manager. More details on how to deploy an agent can be found in the Oracle Enterprise Manager add discovered host blogpost