| name | oraclecloud-install-auth |
| description | Install and configure Oracle Cloud Infrastructure (OCI) SDK and CLI authentication.
Use when setting up a new OCI integration, generating API signing keys, or debugging config file errors.
Trigger with "install oraclecloud", "setup oci auth", "oraclecloud credentials", "oci config".
|
| allowed-tools | Read, Write, Edit, Bash(pip:*), Bash(oci:*), Grep |
| version | 1.7.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","oraclecloud","oci"] |
| compatibility | Designed for Claude Code |
Oracle Cloud Install & Auth
Overview
Configure API key authentication for Oracle Cloud Infrastructure (OCI). OCI auth requires a ~/.oci/config file with five mandatory fields — user OCID, fingerprint, tenancy OCID, region, and the path to an RSA private key. One wrong field produces the cryptic ConfigFileNotFound or InvalidKeyFilePath error with no hint about which field failed.
Purpose: Produce a validated ~/.oci/config file, generate an RSA key pair, upload the public key to OCI, and verify connectivity with both the Python SDK and OCI CLI.
Prerequisites
- OCI account with an active tenancy — sign up at https://cloud.oracle.com
- Python 3.8+ (the OCI Python SDK is the most mature SDK)
- OpenSSL installed (for RSA key generation)
- Your user OCID (Profile > User Settings in the OCI Console) — format:
ocid1.user.oc1..aaaa...
- Your tenancy OCID (Administration > Tenancy Details) — format:
ocid1.tenancy.oc1..aaaa...
- Your home region (e.g.,
us-ashburn-1, eu-frankfurt-1)
Instructions
Step 1: Install the OCI Python SDK and CLI
pip install oci oci-cli
Step 2: Generate an RSA Key Pair
mkdir -p ~/.oci
openssl genrsa -out ~/.oci/oci_api_key.pem 2048
chmod 600 ~/.oci/oci_api_key.pem
openssl rsa -pubout -in ~/.oci/oci_api_key.pem -out ~/.oci/oci_api_key_public.pem
Step 3: Get the Key Fingerprint
openssl rsa -pubout -outform DER -in ~/.oci/oci_api_key.pem | openssl md5 -c
Step 4: Upload Public Key to OCI Console
Navigate to: Profile (top-right) > User Settings > API Keys > Add API Key > Paste Public Key
Paste the contents of ~/.oci/oci_api_key_public.pem. The console shows the fingerprint — it must match Step 3.
Step 5: Create the Config File
> ~/.oci/config <<
[DEFAULT]
user=ocid1.user.oc1..aaaa_YOUR_USER_OCID
fingerprint=ab::ef:12:34:56:78:90:ab::ef:12:34:56:78:90
tenancy=ocid1.tenancy.oc1..aaaa_YOUR_TENANCY_OCID
region=us-ashburn-1
key_file=~/.oci/oci_api_key.pem
EOF
600 ~/.oci/config