02. API Key Based Access Steps - CloudDarsh/OracleCloud GitHub Wiki
First we have to make sure that OCI CLI is installed in our server.
We can follow this document for this –
https://docs.oracle.com/en-us/iaas/Content/API/Concepts/apisigningkey.htm
First we have to create an .oci directory to store the credentials
mkdir ~/.oci
Now we have to generate the private key with the following command
openssl genrsa -out ~/.oci/oci_api_key.pem 2048
Now we can change the file permission to ensure that only you can read the private key file(Optional)
chmod go-rwx ~/.oci/oci_api_key.pem
Now we have to generate the public key from our new private key
openssl rsa -pubout -in ~/.oci/oci_api_key.pem -out ~/.oci/oci_api_key_public.pem
Now we have to copy the contents of the public key and go to OCI
Identity & security Domain Users User Details
Scroll down and select API Keys option Add API Key and paste the public key and click on Add.
Once we click on Add , we will get the preview of configuration file
We can see the new API Key is generated,