Oracle Cloud Console Connection from Linux

Oracle Cloud Console Connection from Linux

Managing Oracle Cloud Infrastructure (OCI) instances often requires direct access to the serial or VNC console for troubleshooting, configuration changes, or kernel debugging. In this guide, we will walk you through the process of establishing both integrated Cloud Shell and local console connections to your Oracle Cloud instances from a Linux environment, including how to resolve common SSH compatibility issues.

Required IAM Permissions

Before attempting to establish a connection, ensure that your user account belongs to a group with the appropriate Identity and Access Management (IAM) permissions. You will need the following policies configured in your tenancy:

Allow group group_name to manage instance-console-connection in tenancy
Allow group group_name to read instance in tenancy

Cloud Shell Console Connection

The fastest way to access your instance’s serial console is through the integrated OCI Cloud Shell. This method handles authentication automatically and does not require local SSH key configuration.

  • Log in to your OCI console.
  • Navigate to Compute Instances and select the specific instance that requires a console connection.
  • Scroll down to the Resources section on the left menu, click on Console Connection, and then click Launch Cloud Shell Connection.

Local Console Connection

If you prefer to use your local Linux terminal or require a VNC connection, you can set up a local console connection using your own SSH key pair.

  • Log in to your OCI console.
  • Navigate to Compute Instances and open the target instance.
  • Under Resources, click on Console Connection, and then click Create Local Connection.
  • Select or upload your public SSH key.
  • Click Create Console Connection and wait for the connection state to show as active.
  • Click the three-dots menu icon next to your connection and select Copy serial console connection for Linux/Mac.
  • Paste the copied command into your local terminal, adjust the path to your private SSH key if necessary, and run it to establish the session.

Troubleshooting Common Connection Errors

Modern Linux distributions often disable older cryptographic algorithms by default, which can lead to connection failures when interfacing with cloud console endpoints.

Error: no matching host key type found. Their offer: ssh-rsa

Solution: To resolve this compatibility issue, you need to append specific configuration lines to your local SSH configuration file located at ~/.ssh/config.

To enable the required algorithm globally for all hosts, use the following configuration:

HostKeyAlgorithms ssh-rsa
PubkeyAcceptedKeyTypes ssh-rsa

If you prefer a more secure approach that restricts these settings exclusively to Oracle Cloud infrastructure endpoints, use this configuration instead:

Host instance-console.*.oci.oraclecloud.com
    HostKeyAlgorithms +ssh-rsa
    PubkeyAcceptedKeyTypes +ssh-rsa

Host ocid1.instance.*
    HostKeyAlgorithms +ssh-rsa
    PubkeyAcceptedKeyTypes +ssh-rsa

By properly configuring your IAM policies and adjusting your local SSH settings, you can reliably access your Oracle Cloud instances whenever out-of-band management is required. Whether you choose the quick Cloud Shell interface or a direct local terminal connection, these steps ensure you maintain critical administrative access to your cloud infrastructure.

Leave a Reply

Your email address will not be published. Required fields are marked *