If you're working with a Compute Unix system, you'll likely need to install a variety of command-line tools to help you manage your system and applications.
In this guide, we'll walk through the steps to install and configure Oracle Cloud CLI tools on an OL8 Unix box, which has seen significant improvements in the installation process compared to earlier versions.
Let's dive in and see how to get started.
Terminal to your box and run the following, accepting all the defaults (10mins)
bash -c "$(curl -L https://raw.githubusercontent.com/oracle/oci-cli/master/scripts/install/install.sh)"
When installed, verify the installation
oci --version
Now use the Setup Dialog
oci setup config
When asked for the user OCID... Go into OCI, click on Profile, username, then copy the OCID and paste it into the terminal
When asked for the tenancy OCID... Go into OCI, click on Profile, tenancy, then copy the OCID and paste it into the terminal
When asked for the availability domain, match the home region (see page above), and type the number in.
I typed 23 for Frankfurt
On the keys section, accept the defaults, however, type N/A when asked for a passphrase
When complete type the below and copy it to the clipboard
cat ~/.oci/oci_api_key_public.pem
In OCI, View the details for the user who will be calling the API with the key pair:
If you're signed in as the user:
Open the Profile menu and click My Profile.
If you're an administrator doing this for another user: Open the navigation menu and click Identity & Security. Under Identity, click Users. Select the user from the list.
Click Add API Key > Add API Key > Paste Public Key
Click Add & Close the next window
IMPORTANT: exit terminal and create a new terminal connection
Back in the console, try a command, e.g list users
oci iam user list
this should return
{ "data": [ { "capabilities": { "can-use-api-keys": true, "can-use-auth-tokens": true, "can-use-console-password": true, "can-use-customer-secret-keys": true, "can-use-db-credentials": true, "can-use-o-auth2-client-credentials": true, "can-use-smtp-credentials": true }, "compartment-id": "ocid1.tenancy.oc1..aa
ENJOY!