Approach 2: Connect via Terminal Console to the Compute Instance using SSH Username and Password with the OCI Cloud Shell Console
This approach can be used as a backdoor when you do not have any network connectivity to your instance and logging in with SSH is not possible.
Prerequisites for approach 2
We need to create the local username and password first and to do this we need to log in with SSH using the private key using one of the other approaches. This is done in Approach 1, 3, 4, 5 and 6.
- When we log in with SSH using a private key, we can create a new local username and assign a password to that new username. Run the following commands.
 
sudo useradd console
sudo passwd console
It is also possible to create a new local username and password at the instance creation process. But we will show this in another tutorial.
Continue with approach 2
Now that we have created the local username and password we can continue with connecting via the terminal console to the compute instance using SSH username and password with the OCI Cloud Shell console.
In this approach, we will connect to a Linux instance using the local console provided by OCI to connect directly to the instance using the OCI Cloud Shell.
- Connect to the OCI Cloud Shell.
 
- In Instance details page, scroll down.
 - Click Console Connection to start OCI Cloud Shell and connect to the console.
 
- Click Launch Cloud Shell connection.
 
- 
The OCI Cloud Shell window only provides a username and not a password.
 - 
This username and password needs to be created and are not there by default.
 
- The OCI Cloud Shell window will be opened.
 - The prompt provides an username.
 
- Type in the local username and password in the console terminal.