Oracle Cloud Infrastructure Cloud (OCI) Shell is a web browser-based terminal accessible from the Oracle Cloud Console. Cloud Shell is free to use (within monthly tenancy limits), and provides access to a Linux shell, with a pre-authenticated Oracle Cloud Infrastructure CLI, a pre-authenticated Ansible installation, and other useful tools for following Oracle Cloud Infrastructure service tutorials and labs. Cloud Shell is a feature available to all OCI users, accessible from the Console. Your Cloud Shell will appear in the Oracle Cloud Console as a persistent frame of the Console, and will stay active as you navigate to different pages of the Console.
Cloud Shell provides:
An ephemeral machine to use as a host for a Linux shell, pre-configured with the latest version of the OCI Command Line Interface (CLI) and a number of useful tools
5GB of storage for your home directory
A persistent frame of the Console which stays active as you navigate to different pages of the console
How Cloud Shell Works
The Cloud Shell machine is a small virtual machine running a Bash shell which you access through the OCI Console. Cloud Shell comes with a pre-authenticated OCI CLI, set to the Console tenancy home page region, as well as up-to-date tools and utilities.
Cloud Shell comes with 5GB of persistent storage for the home directory, so you can make local changes to your home directory, and then continue working on your project when you come back to Cloud Shell.
Cloud Shell is free to use (within your tenancy's monthly limits) and doesn’t require any setup or prerequisites other than an IAM policy granting access to Cloud Shell. Your Cloud Shell includes a VM provisioned for you that executes in its own tenancy (so it doesn't use any of your tenancy's resources) and hosts your shell in an Oracle Linux OS while you’re actively using Cloud Shell.
What's Included With Cloud Shell
In addition to the OCI CLI, the Cloud Shell VM comes with current versions of several useful tools and utilities pre-installed, including:
- Python (2 and 3)
- SQL Plus
Required IAM Policy
To get started with Cloud Shell, you’ll need to grant user access to Cloud Shell via an IAM policy. Each service in Oracle Cloud Infrastructure integrates with IAM for authentication and authorization, for all interfaces (the Console, SDK or CLI, and REST API).
To use Oracle Cloud Infrastructure, you must be given the required type of access in a policy written by an administrator in the tenancy's root compartment, whether you're using the Console or the REST API with an SDK, CLI, or other tool. If you try to perform an action and get a message that you don’t have permission or are unauthorized, confirm with your administrator that you've been granted access.
The resource name for Cloud Shell is `cloud-shell`. The following is an example policy to grant access to Cloud Shell:
allow group <GROUP-NAME> to use cloud-shell in tenancy
Cloud Shell Limitations
Keep the following limitations in mind when using Cloud Shell:
- Cloud Shell comes with 5GB of storage for the VM's home directory. This storage is persistent from session to session, but after 6-months of non-use, the administrator for your tenancy will receive a notification that the storage will be removed in 60 days. Starting a cloud shell session resets the storage removal timer.
The OCI CLI will execute commands against the region selected in the Console's Region selection menu when the Cloud Shell was started. Changing the region selection in the console will not change the region for existing Cloud Shell instances; you will need to open a new Cloud Shell instance to change regions.
- Cloud Shell sessions have a maximum length of 24 hours, and time out after 20 minutes of inactivity.
- Cloud Shell is designed for interactive use with Oracle Cloud Infrastructure resources. Users who need additional storage for Cloud Shell or want to run non-interactive long-running tasks are encouraged to use Compute and Storage resources in their tenancy.
- The following reserved words can't be used as the user name for a Cloud Shell user:
apache. Attempting to create a Cloud Shell session when logged in with a user name (or the part of the name before the @ sign if the user name is an email address) that is one of these reserved words will result in an "Unexpected Error" message.
- Entirely numerical user names (for example, "1234") are not supported by Cloud Shell.
- For more information on Cloud Shell limits, see the Cloud Shell section in Service Limits.
Cloud Shell Access and Other Restrictions
You can access OCI resources from Cloud Shell according to the policies granted by your tenancy administrator. There is no additional access because you're using Cloud Shell, and Cloud Shell does not provide any additional access to your tenancy, or private resources in your tenancy VCNs.
While Cloud Shell provides access to the internet, there is no ingress from the outside world into Cloud Shell (for example: you cannot ssh in to Cloud Shell). If your tenancy admin does not want to enable access to the internet from OCI, they should not grant access to Cloud Shell with an IAM policy.
Cloud Shell Resource Location
When you first start Cloud Shell, the service creates a persistent block storage volume (5GB) for your home directory. The home directory volume is located in your tenancy home region. The machine running your Cloud Shell session is also located in your tenancy home region.
Changing the Console region selection, or logging in to the Console via a different regional URL will have no effect on where your Cloud Shell machine and home directory volume are located. To confirm your tenancy home region, view your Tenancy Details page in the Console.
Cloud Shell and Regions
When you start Cloud Shell, the service configures your Cloud Shell session with the currently selected region in the Console so that the OCI CLI is interacting with the selected Console region.
In the default bash prompt in Cloud Shell, the region that the OCI CLI is interacting with is echoed in the Cloud Shell command line prompt:
Any changes to the selected region in Console after you've started your Cloud Shell session will not have an effect on your active Cloud Shell session.If you want to change the region that the OCI CLI is interacting with, in Cloud Shell, you can either:
- Exit your current Cloud Shell session, then change the selected region in the Console, then start a new Cloud Shell session.
- Modify the currently selected OCI CLI profile via the OCI_CLI_PROFILE environment variable
For more information, see the "Managing Regions" section in Using Cloud Shell.