Index of every page on this site: llms.txt
All skills
jeremylongshore avatar

/oraclecloud-install-auth

@820dfc8
Run it yourself

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".

Use this Skill: https://skilld.dev/gh/jeremylongshore/tons-of-skills-marketplace/oraclecloud-install-auth

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈77 tokens for metadata: the name and description. ≈1.7k when used: this file. ≈471 more on demand in 1 file.

Description uses 3.9% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈310 characters, or 3.9%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

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
# Output: ab:cd:ef:12:34:56:78:90:ab:cd:ef:12:34:56:78:90

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

cat > ~/.oci/config << 'EOF'
[DEFAULT]
user=ocid1.user.oc1..aaaa_YOUR_USER_OCID
fingerprint=ab:cd:ef:12:34:56:78:90:ab:cd: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
chmod 600 ~/.oci/config

All five fields are required. The key_file must point to the private key (not the public .pem).

Step 6: Verify with the Python SDK

import oci

config = oci.config.from_file("~/.oci/config")
oci.config.validate_config(config)

identity = oci.identity.IdentityClient(config)
user = identity.get_user(config["user"]).data
print(f"Authenticated as: {user.name} ({user.email})")
print(f"Tenancy: {config['tenancy']}")
print(f"Region: {config['region']}")

Step 7: Verify with the OCI CLI

oci iam user get --user-id "$(grep ^user ~/.oci/config | cut -d= -f2)" \
  --query 'data.name' --raw-output

Step 8: Config Validation Script

Save this as validate_oci_config.py to catch common misconfigurations:

import oci
import os

def validate():
    """Validate OCI config file and key access."""
    config_path = os.path.expanduser("~/.oci/config")
    if not os.path.exists(config_path):
        raise FileNotFoundError(f"Config not found: {config_path}")

    config = oci.config.from_file(config_path)
    oci.config.validate_config(config)

    key_path = os.path.expanduser(config.get("key_file", ""))
    if not os.path.exists(key_path):
        raise FileNotFoundError(f"Private key not found: {key_path}")

    perms = oct(os.stat(key_path).st_mode)[-3:]
    if perms != "600":
        print(f"WARNING: Key file permissions are {perms}, should be 600")

    identity = oci.identity.IdentityClient(config)
    identity.get_user(config["user"])
    print("Config is valid. Authentication successful.")

validate()

Output

Successful completion produces:

  • An RSA key pair at ~/.oci/oci_api_key.pem (private) and ~/.oci/oci_api_key_public.pem (public)
  • A validated ~/.oci/config with all five required fields
  • The public key uploaded to your OCI user profile with a matching fingerprint
  • Confirmed API connectivity via either the Python SDK or OCI CLI

Error Handling

Error Code Cause Solution
NotAuthenticated 401 Wrong fingerprint or key mismatch Verify fingerprint matches: openssl rsa -pubout -outform DER -in ~/.oci/oci_api_key.pem | openssl md5 -c
ConfigFileNotFound — Missing ~/.oci/config Run oci setup config or create manually per Step 5
InvalidKeyFilePath — key_file points to wrong path or public key Ensure key_file=~/.oci/oci_api_key.pem (private key, no _public)
InvalidPrivateKey — Key file is the public key, not private The private key starts with -----BEGIN RSA PRIVATE KEY-----
NotAuthorizedOrNotFound 404 User OCID is wrong or IAM policy missing Double-check user OCID in Console > Profile > User Settings
CERTIFICATE_VERIFY_FAILED — SSL cert issue behind corporate proxy Set OCI_PYTHON_SDK_NO_SERVICE_IMPORTS=1 or install certifi

Examples

Quick auth test with curl (no SDK needed):

# Verify the OCI CLI can reach the API
oci iam region list --output table

Multiple profiles for dev/staging/prod:

# ~/.oci/config
[DEFAULT]
user=ocid1.user.oc1..aaaa_PROD_USER
tenancy=ocid1.tenancy.oc1..aaaa_PROD
region=us-ashburn-1
fingerprint=ab:cd:...
key_file=~/.oci/oci_api_key.pem

[STAGING]
user=ocid1.user.oc1..aaaa_STAGING_USER
tenancy=ocid1.tenancy.oc1..aaaa_STAGING
region=us-phoenix-1
fingerprint=12:34:...
key_file=~/.oci/oci_api_key_staging.pem
# Load a specific profile
config = oci.config.from_file("~/.oci/config", profile_name="STAGING")

Resources

Next Steps

After authentication is working, proceed to oraclecloud-hello-world to launch your first compute instance, or see oraclecloud-common-errors if you hit authentication issues.

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts2mo3 checks · Risk SAFE
  • Gen Agent Trust Hub2mo

    This skill provides a secure and guided process for installing and configuring Oracle Cloud Infrastructure (OCI) authentication. It follows industry best practices by generating local RSA keys with restrictive file permissions and using official, well-known OCI libraries for verification.

  • Socket2mo

    No alerts

  • Snyk2mo

    Risk: LOW · No issues

Signed by skilld at 820dfc8. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 20 hours ago.

Activeupdated 3 months ago
What it can do
Reads files Edits files Runs commands
version
1.8.0
author
Jeremy Longshore <jeremy@intentsolutions.io>
tags
[
  "saas",
  "oraclecloud",
  "oci"
]
All 6 allowed tools
ReadWriteEditBash(pip:*)Bash(oci:*)Grep
Other metadata
compatibility
Designed for Claude Code

README badge

README badge for jeremylongshore/tons-of-skills-marketplace/oraclecloud-install-auth