Sunday, February 2, 2020

Give sudo privilege to Oracle user in OCI

In my last post, https://samappsdba.blogspot.com/2020/02/create-ssh-keys-for-newly-provisioned.html i explained, how to generate ssh keys for newly provisioned instances in Oracle Cloud and using private key, we connect to those instances using putty. Normally there will be two user for connecting to the instances. One is opc and another one will be oracle user. If we connect via opc user,




opc is the master user and it has the sudo privileges to connect to oracle user and root user. It doesn't ask for any password.

But if connect to the instance via oracle user and try to do a sudo, it prompts for oracle's password.



By any chance if anyone tampers with opc user, we will not be able to connect to opc or root user.

Thus to resolve this squabble, using root user, we added the below line at the bottom of the file-/etc/sudoers


## Same thing without a password
oracle        ALL=(ALL)       NOPASSWD: ALL



And thereafter we were able to connect to opc and root from oracle user.


Hope it helps someone. Happy learning.

No comments:

Post a Comment