# Oracle Cloud

# Installing aaPanel on oracle cloud virtual machine

aaPanel is a free and open-source hosting control panel that can be installed on popular Linux distributions like Ubuntu, CentOS, Debian, etc. In this post, I would like to tell you step by step to installation instructions.

You can use any cloud provider for this but I am using the oracle cloud free tier. They have very attractive free cloud resources that you probably don't know. In summary, you can get

- 2 AMD-based VMs with 1 GB ram each
- Arm-based Ampere A1 cores and 24 GB of memory usable as 1 VM or up to 4 VMs with 3,000 OCPU hours and 18,000 GB hours per month
- 2 Block Volumes Storage, 200 GB total
- And many more. Check out their [offerings](https://www.oracle.com/cloud/free/?ref=gkibria.com).

### Pre-requisites

- An oracle cloud free tier account
- knowledge of some basic Linux commands

## Step 1: Creating the VM

In this step, we will create a new AMD-based VM, with **CentOS 7** image. You can use other images (Ubuntu, Oracle Linux, CentOS 8, etc.) also. But there is a benefit to using CentOS 7. Later, when you install server software (Nginx, MySQL, etc.), aaPanel will give you 2 options - **Fast** and **Compile**. Fast will use pre-compiled binaries that are very fast to install but compile options are very stable because it will download sources, and compile them according to your server environment.

<div class="kg-card kg-callout-card kg-callout-card-grey" id="bkmrk-%F0%9F%92%A1-if-you-use-centos-" style="box-sizing: border-box; grid-column: main-start / main-end; margin-bottom: 0px; margin-top: 38px; display: flex; padding: 1.2em 1.6em; border-radius: 0.25em; background: rgba(124, 139, 154, 0.13); color: rgb(51, 51, 51); font-family: Mulish, -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif; font-size: 19px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><div class="kg-callout-emoji" style="box-sizing: border-box; padding-right: 0.8em; line-height: 1.25em; font-size: 1.15em;">💡</div><div class="kg-callout-text" style="box-sizing: border-box; font-size: 0.95em; line-height: 1.5em;">If you use CentOS 7, installation of the subsequent software on aaPanel will be significantly fast. Otherwise, compilation will be done which will be time-consuming and resource intensive.</div></div>Let's create the VM.

- Log In to your oracle cloud console
- Go to your [compute instance](https://cloud.oracle.com/compute/instances?ref=gkibria.com) page and click **create instance** button.
- Chose a name of the instance, e.g. aapanel-centos-7
- Edit the Image and Shape &gt; click **Change image** &gt; Select **CentOS**, OS version to **7** &gt; click **Select image**
- Under **Add SSH keys**, you can **generate key pairs** (default option) if you haven't already done so. Download the private and public keys and keep them in a separate folder. This will be needed later to log in to the server. If you already have those keys, select **upload public key** and chose .pub file.
- Finally, click **create** button. This will start the process and a few minutes later, your instance will be ready to install aaPanel.

## Step 2: Installing aaPanel

In this step, we will log in to our newly created VM, update the server software, and install aaPanel. For this, we need some info - server\_public\_ip, username, and the private key that you used during the creation of the VM. You will find this information on the instance page under the **instance access** heading.

- Open your terminal or command prompt and navigate to the folder where you kept the SSH keys
- Log in to the VM using the following command. Replace **username**, **server\_public\_ip**, and **your\_private.key** with your own info.

```bash
ssh username@server_public_ip -i your_private.key
```

- Switch to the root user

```bash
sudo su -
```

- Update the server

```bash
yum update
```

- Install the aaPanel by entering the following code

```bash
yum install -y wget && wget -O install.sh http://www.aapanel.com/script/install_6.0_en.sh && bash install.sh aapanel
```

### installation prompts

The installation will prompt you for some info and confirmations. Here are my response

- installation directory /www - **y**
- panel SSL - **N** (will configure it later)

If everything goes well, the installation process will end in around 8 minutes. After installation is finished, you will find some login credentials and ports information. **Save this info**, you need it for accessing the panel.

## Step 3: Open ports in the firewall

You will find some port information from the previous step. You need to open these ports in the cloud provider's firewall. In our case, *default security list*. To find this page, search the keyword **security list** in the search box on the console. Alternatively, you can go there from the instance detail page &gt; virtual cloud network &gt; security lists under resources.

In the security list page, you must **Add Ingress Rules** for all the ports according to the following table

<table id="bkmrk-source-type-source-c" style="box-sizing: border-box; grid-column: main-start / main-end; margin: 0px; font-family: georgia, serif; font-size: 1.75rem; letter-spacing: 0.02rem; line-height: 1.6em; color: rgb(51, 51, 51); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; orphans: 2; text-align: start; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><thead style="box-sizing: border-box;"><tr style="box-sizing: border-box;"><th style="box-sizing: border-box; border-bottom: 1px solid rgb(235, 238, 240); line-height: 20px; padding: 8px; text-align: left; vertical-align: top;">source type</th><th style="box-sizing: border-box; border-bottom: 1px solid rgb(235, 238, 240); line-height: 20px; padding: 8px; text-align: left; vertical-align: top;">source CIDR</th><th style="box-sizing: border-box; border-bottom: 1px solid rgb(235, 238, 240); line-height: 20px; padding: 8px; text-align: left; vertical-align: top;">IP protocol</th><th style="box-sizing: border-box; border-bottom: 1px solid rgb(235, 238, 240); line-height: 20px; padding: 8px; text-align: left; vertical-align: top;">Destination port range</th><th style="box-sizing: border-box; border-bottom: 1px solid rgb(235, 238, 240); line-height: 20px; padding: 8px; text-align: left; vertical-align: top;">Description</th></tr></thead><tbody style="box-sizing: border-box;"><tr style="box-sizing: border-box;"><td style="box-sizing: border-box; border-bottom: 1px solid rgb(235, 238, 240); line-height: 20px; padding: 8px; text-align: left; vertical-align: top;">CIDR</td><td style="box-sizing: border-box; border-bottom: 1px solid rgb(235, 238, 240); line-height: 20px; padding: 8px; text-align: left; vertical-align: top;">0.0.0.0/0</td><td style="box-sizing: border-box; border-bottom: 1px solid rgb(235, 238, 240); line-height: 20px; padding: 8px; text-align: left; vertical-align: top;">TCP</td><td style="box-sizing: border-box; border-bottom: 1px solid rgb(235, 238, 240); line-height: 20px; padding: 8px; text-align: left; vertical-align: top;">port</td><td style="box-sizing: border-box; border-bottom: 1px solid rgb(235, 238, 240); line-height: 20px; padding: 8px; text-align: left; vertical-align: top;">aapanel</td></tr></tbody></table>

## Step 4: Installing software modules

Now log in to the newly installed aapanel using the credentials. Immediately after login, you will be prompted to install the necessary stack (LNMP/LAMP). Choose your stack. For example, I will go for Nginx, MySQL 8, PHP 8, and phpMyAdmin 5. And never forget to check for the **FAST** option to install from binary.

## Step 5: Installing SSL and panel domain

In this step, you need a domain name, to install SSL in your panel. You can use a subdomain also. I prefer to add a subdomain rather than a domain as a panel URL.

- Add an **A record** to your domain DNS pointing to the server's **Public IP**. If you are using Cloudflare, be sure to uncheck the proxy.
- In the aaPanel, go to **Settings**. Enter the selected domain in the domain text field under the security tab. When you click save, the panel will set the domain and you can no longer access it with the IP address. So, you may see a blank page. Replace the IP with your domain in the browser's address bar and log in again.
- Now let's install SSL. Go to the settings, and click the Panel SSL switch under the security section. A dialog window will appear. Select the let's encrypt option, enter your email, check the terms, and submit. After a few moments, your panel will reload with the HTTPS protocol.

In certain cases, you may get some errors. If you can't log in to the panel, try removing the SSL options. Log in to the server via SSH, and enter the following command.

```bash
rm -f /www/server/panel/data/ssl.pl && /etc/init.d/bt restart
```

Other panel ssh commands

<iframe allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen="allowfullscreen" frameborder="0" height="540" src="https://www.youtube.com/embed/ri22jwFxFW4" title="Installing aaPanel on oracle cloud virtual machine" width="720"></iframe>

# Connecting to a Linux Oracle instance

You can connect to a running Linux instance by using a Secure Shell (SSH) connection.

<div class="body" id="bkmrk-%C2%A0importantalternativ" style="--uk-inverse: initial; outline: 0px; color: rgb(71, 66, 62); font-family: 'Oracle Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><section class="section" style="--uk-inverse: initial;"><div class="uk-alert uk-alert-success" style="--uk-inverse: initial; outline: 0px; position: relative; margin-bottom: 20px; padding: 15px 29px 15px 15px; background: rgb(228, 249, 241); color: rgb(21, 96, 68);"><span class="vl-1px-up uk-icon" style="--uk-inverse: initial; margin: 0px; border: none; border-radius: 0px; overflow: visible; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; font-family: inherit; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; color: inherit; text-transform: none; padding: 0px; background-color: rgba(0, 0, 0, 0); display: inline-block; fill: currentcolor; line-height: 0; position: relative; bottom: 1px;"><svg height="20" viewbox="0 0 20 20" width="20"><polyline fill="none" points="4,10 8,15 17,4" stroke="#000" stroke-width="1.1"></polyline></svg></span> **Important**  
  
Alternatively, for advanced control of the boot process or OS troubleshooting, you can use the serial console to connect to an instance. For details, see - [Making a Local Connection to the Console](https://docs.oracle.com/en-us/iaas/Content/Compute/References/serialconsole.htm#make-a-local-connection)
- [Creating a Console Connection Using Cloud Shell](https://docs.oracle.com/en-us/iaas/Content/Compute/References/serialconsole.htm#creating-instance-connection-cloud-shell)

</div></section><section class="section" id="bkmrk-connecting-to-a-linu" style="--uk-inverse: initial;">## Connecting to a Linux Instance with SSH

Current versions of Windows, MacOS, and Linux include an OpenSSH client by default. (Windows has included the [OpenSSH client](https://docs.microsoft.com/windows-server/administration/openssh/openssh_install_firstuse) since Windows 10 and Windows Server 2019.) When you create an instance, OCI Compute generates OpenSSH keys for you. You download the keys and use them to connect to your instance.

<div class="uk-alert uk-alert-success" style="--uk-inverse: initial; outline: 0px; position: relative; margin-bottom: 20px; padding: 15px 29px 15px 15px; background: rgb(228, 249, 241); color: rgb(21, 96, 68); margin-top: 20px;"><span class="vl-1px-up uk-icon" style="--uk-inverse: initial; margin: 0px; border: none; border-radius: 0px; overflow: visible; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; font-family: inherit; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; color: inherit; text-transform: none; padding: 0px; background-color: rgba(0, 0, 0, 0); display: inline-block; fill: currentcolor; line-height: 0; position: relative; bottom: 1px;"><svg height="20" viewbox="0 0 20 20" width="20"><polyline fill="none" points="4,10 8,15 17,4" stroke="#000" stroke-width="1.1"></polyline></svg></span> **Important**  
  
**SSH keys required:** To connect to your instance with SSH, you must have SSH keys. - If you lost your SSH keys, terminate the instance and create a new instance using the SSH keys provided or SSH keys you generated. See [Managing Key Pairs on Linux Instances](https://docs.oracle.com/en-us/iaas/Content/Compute/Tasks/managingkeypairs.htm).
- If you created an instance without SSH keys, you can use the [serial console](https://docs.oracle.com/en-us/iaas/Content/Compute/References/serialconsole.htm) to connect to your instance and configure SSH. For Oracle Linux, see this [example on how to reset the SSH key for the `opc` user](https://docs.oracle.com/en-us/iaas/Content/Compute/References/serialconsole.htm#instance-console-linux-troubleshooting__resetsshkey) using the serial console.

</div>For SSH troubleshooting suggestions, see [Troubleshooting the SSH Connection](https://docs.oracle.com/en-us/iaas/Content/Compute/Tasks/troubleshooting-ssh-connection.htm "If you're unable to connect to a compute instance using SSH, review the following troubleshooting error messages and suggestions to resolve the issue.").

<div class="uk-alert uk-alert-primary" style="--uk-inverse: initial; outline: 0px; position: relative; margin-bottom: 20px; padding: 15px 29px 15px 15px; background: none 0% 0% / auto repeat scroll padding-box border-box rgb(197, 225, 235); color: rgb(0, 17, 23); margin-top: 20px;"><span class="vl-1px-up uk-icon" style="--uk-inverse: initial; margin: 0px; border: none; border-radius: 0px; overflow: visible; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; font-family: inherit; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; color: inherit; text-transform: none; padding: 0px; background-color: rgba(0, 0, 0, 0); display: inline-block; fill: currentcolor; line-height: 0; position: relative; bottom: 1px;"><svg height="20" viewbox="0 0 20 20" width="20"><path d="M18.65,1.68 C18.41,1.45 18.109,1.33 17.81,1.33 C17.499,1.33 17.209,1.45 16.98,1.68 L8.92,9.76 L8,12.33 L10.55,11.41 L18.651,3.34 C19.12,2.87 19.12,2.15 18.65,1.68 L18.65,1.68 L18.65,1.68 Z" fill="none" stroke="#000"></path><polyline fill="none" points="16.5 8.482 16.5 18.5 3.5 18.5 3.5 1.5 14.211 1.5" stroke="#000"></polyline></svg></span> **Note**  
  
For older Windows versions, you can also use the free PuTTY SSH client. See: [Connecting to a Linux Instance using PuTTY and Windows](https://docs.oracle.com/en-us/iaas/Content/Compute/Tasks/connect-to-linux-instance-from-windows-putty.htm "PuTTY is a free implementation of SSH and Telnet for Windows. The program includes an xterm terminal emulator. PuTTY generates its own public and private SSH keys but can interoperate with OpenSSH keys.").</div></section></div><article aria-labelledby="ariaid-title2" class="topic nested1 consolehelp" id="bkmrk-before-you-begin-you" style="--uk-inverse: initial; color: rgb(71, 66, 62); font-family: 'Oracle Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">## Before You Begin

You must have the following information to connect to a Linux instance:

<div class="body" style="--uk-inverse: initial; outline: 0px;">- <div class="p" style="--uk-inverse: initial; outline: 0px;">**Public IP address for an instance:** Use the public IP address assigned when you created the instance. If you didn't note the address, get the address from the Instance Details page: 
    - Open the **navigation menu <span class="vl-1px-up uk-icon" style="--uk-inverse: initial; margin: 0px; border: none; border-radius: 0px; overflow: visible; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; font-family: inherit; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; color: inherit; text-transform: none; padding: 0px; background-color: rgba(0, 0, 0, 0); display: inline-block; fill: currentcolor; line-height: 0; position: relative; bottom: 1px;"><svg height="16" viewbox="0 0 20 20" width="16"><path d="M12.13,11.59 C11.97,12.84 10.35,14.12 9.1,14.16 C6.17,14.2 9.89,9.46 8.74,8.37 C9.3,8.16 10.62,7.83 10.62,8.81 C10.62,9.63 10.12,10.55 9.88,11.32 C8.66,15.16 12.13,11.15 12.14,11.18 C12.16,11.21 12.16,11.35 12.13,11.59 C12.08,11.95 12.16,11.35 12.13,11.59 L12.13,11.59 Z M11.56,5.67 C11.56,6.67 9.36,7.15 9.36,6.03 C9.36,5 11.56,4.54 11.56,5.67 L11.56,5.67 Z"></path><circle cx="10" cy="10" fill="none" r="9" stroke="#000" stroke-width="1.1"></circle></svg></span>** and select **Compute**. Under **Compute**, select **Instances**.
    - Select your instance.
    - Look at the **Instance access** section. If a public IP address is assigned, the address will be labeled: **Public access IP address**.
    - If no public IP address is assigned, see [Assigning an Ephemeral Public IP to an Existing Primary Private IP](https://docs.oracle.com/iaas/Content/Network/Tasks/assigning-ephemeral-public-existing-private-ip.htm#top).
    
    </div>
- **Username:** The username used to connect to the Linux instance. Default users names are assigned based on the Linux distribution used. <div style="--uk-inverse: initial; outline: 0px;">
    - For Oracle Linux or Redhat Enterprise Linux compatible platform images the username is `opc`.
    - For Ubuntu platform images to create the instance, the username is `ubuntu`.
    
    </div>
- **SSH private key:** The full path to the private key file from the SSH key pair used to create the instance. For more information about key pairs, see [Managing Key Pairs on Linux Instances](https://docs.oracle.com/en-us/iaas/Content/Compute/Tasks/managingkeypairs.htm).

</div></article><article aria-labelledby="ariaid-title3" class="topic nested1 consolehelp" id="bkmrk-connecting-to-a-linu-2" style="--uk-inverse: initial; color: rgb(71, 66, 62); font-family: 'Oracle Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">## Connecting to a Linux Instance from a Windows System Using OpenSSH

Using the OCI generated key pair or your own generated key pair used to create the instance, connect to the Linux instance.

<div class="body" style="--uk-inverse: initial; outline: 0px;"><div id="bkmrk-set-the-permissions-" style="--uk-inverse: initial; outline: 0px;"><dl style="--uk-inverse: initial; margin: 20px 0px;"><dt class="dt dlterm" style="--uk-inverse: initial; font-weight: bold; margin: 2rem 0px 0.5rem;">Set the Permissions for the Private Key File</dt><dd class="dd" style="--uk-inverse: initial; margin: 0px 0px 1.5rem 1rem;">Set the file permissions for the private key file so that only the current user has read-only access. Do the following:

1. Locate the SSH key files you created by or created for your instance.
2. In Windows Explorer, navigate to the private key file, right-click the file.
3. Select **Properties**.
4. On the **Security** tab, select **Advanced**.
5. On the **Permissions** tab, for **Permission entries**, under **Principal**, ensure that your user account is listed.
6. Select **Disable Inheritance**, and then select **Convert inherited permissions into explicit permissions on this object**.
7. For **Permission entries**, select each permission entry that isn't your user account and select **Remove**.
8. Ensure that the access permission for your user account is **Full control**.
9. Save your changes.

</dd><dt class="dt dlterm" style="--uk-inverse: initial; font-weight: bold; margin: 2rem 0px 0.5rem;">Connect to the Instance with PowerShell</dt><dd class="dd" style="--uk-inverse: initial; margin: 0px 0px 1.5rem 1rem;">Next, connect to the instance with PowerShell.

1. Open Windows PowerShell and run the following command:
    
    <div class="uk-position-relative" style="--uk-inverse: initial; outline: 0px; position: relative !important;"><div class="vl-code-toolbar" style="--uk-inverse: initial; outline: 0px; margin-top: 20px; border-width: 1px 1px 0px; border-image: initial; border-radius: 3px 3px 0px 0px; border-color: rgb(196, 206, 215) rgb(196, 206, 215) initial rgb(196, 206, 215); border-style: solid solid initial solid;"><div class="uk-width-1-1 false" style="--uk-inverse: initial; outline: 0px; box-sizing: border-box; width: 625.2px; max-width: 100%;"><div class="uk-grid-small uk-grid" style="--uk-inverse: initial; outline: 0px; display: flex; flex-wrap: wrap; margin: -1px -1px 0px -15px; padding: 0px; list-style: none;" uk-grid=""><div class="uk-width-expand uk-text-small uk-text-bold uk-first-column" style="--uk-inverse: initial; outline: 0px; margin: 0px; padding-left: 15px; box-sizing: border-box; width: 546.975px; max-width: 100%; flex: 1 1 0%; min-width: 1px; font-size: 0.875rem; line-height: 1.5; font-weight: bold;">  
    </div><div class="uk-width-auto uk-button-group" style="--uk-inverse: initial; outline: 0px; display: inline-flex; vertical-align: middle; position: relative; margin: 0px; padding-left: 15px; box-sizing: border-box; width: auto; max-width: 100%;"><button class="uk-button uk-button-default uk-button-small vl-button-icon" style="--uk-inverse: initial; margin: 0px; border-image: none 100% / 1 / 0 stretch; overflow: visible; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-family: inherit; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; color: rgb(51, 51, 51); text-transform: none; appearance: none; display: inline-block; box-sizing: border-box; vertical-align: middle; font-size: 0.75rem; line-height: 28px; text-align: center; text-decoration: none; border-radius: 0px 3px 0px 0px; transition: 0.1s cubic-bezier(0.51, 0.01, 0.37, 0.98); padding: 0px 15px; background-color: rgb(255, 255, 255); cursor: pointer; border: 0.8px solid rgb(196, 206, 215);" type="submit"><span class="uk-icon" style="--uk-inverse: initial; margin: 0px 0.3em 0px 0px; border: none; border-radius: 0px; overflow: visible; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; font-family: inherit; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; color: inherit; text-transform: none; padding: 0px; background-color: rgba(0, 0, 0, 0); display: inline-block; fill: currentcolor; line-height: 0; position: relative; bottom: 0.1em;"><svg height="16" viewbox="0 0 20 20" width="16"><rect fill="none" height="16" stroke="#000" width="12" x="3.5" y="2.5"></rect><polyline fill="none" points="5 0.5 17.5 0.5 17.5 17" stroke="#000"></polyline></svg></span>Copy</button></div></div></div></div></div>```
    ssh -i <var class="keyword varname" style="--uk-inverse: initial; color: rgb(204, 0, 0); font-style: italic;"><private_key_file></var> <var class="keyword varname" style="--uk-inverse: initial; color: rgb(204, 0, 0); font-style: italic;"><username></var>@<var class="keyword varname" style="--uk-inverse: initial; color: rgb(204, 0, 0); font-style: italic;"><public-ip-address></var>
    ```
    
    <var class="keyword varname" style="--uk-inverse: initial; color: rgb(204, 0, 0); font-style: italic;">&lt;private\_key\_file&gt;</var> is the full path and name of the `.key` file that contains the private key associated with the instance you want to access.
    
    <var class="keyword varname" style="--uk-inverse: initial; color: rgb(204, 0, 0); font-style: italic;">&lt;username&gt;</var> is the default username for the instance. For Oracle Linux and Redhat Enterprise Linux compatible images, the default username is `opc`. For Ubuntu images, the default username is `ubuntu`.
    
    <var class="keyword varname" style="--uk-inverse: initial; color: rgb(204, 0, 0); font-style: italic;">&lt;public-ip-address&gt;</var> is the instance's IP address that you retrieved from the Console.
2. If you're connecting to this instance for the first time, you need to accept the fingerprint of the key. To accept the fingerprint, type **yes** and press **Enter**.
3. You are connected to the default shell for the instance.
4. When you have finished your session, type `exit` at the shell prompt to end the session.

</dd></dl></div><div class="uk-alert uk-alert-primary" style="--uk-inverse: initial; outline: 0px; position: relative; margin-bottom: 20px; padding: 15px 29px 15px 15px; background: none 0% 0% / auto repeat scroll padding-box border-box rgb(197, 225, 235); color: rgb(0, 17, 23); margin-top: 20px;"><span class="vl-1px-up uk-icon" style="--uk-inverse: initial; margin: 0px; border: none; border-radius: 0px; overflow: visible; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; font-family: inherit; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; color: inherit; text-transform: none; padding: 0px; background-color: rgba(0, 0, 0, 0); display: inline-block; fill: currentcolor; line-height: 0; position: relative; bottom: 1px;"><svg height="20" viewbox="0 0 20 20" width="20"><path d="M18.65,1.68 C18.41,1.45 18.109,1.33 17.81,1.33 C17.499,1.33 17.209,1.45 16.98,1.68 L8.92,9.76 L8,12.33 L10.55,11.41 L18.651,3.34 C19.12,2.87 19.12,2.15 18.65,1.68 L18.65,1.68 L18.65,1.68 Z" fill="none" stroke="#000"></path><polyline fill="none" points="16.5 8.482 16.5 18.5 3.5 18.5 3.5 1.5 14.211 1.5" stroke="#000"></polyline></svg></span> **Note**  
  
For SSH troubleshooting suggestions, see [Troubleshooting the SSH Connection](https://docs.oracle.com/en-us/iaas/Content/Compute/Tasks/troubleshooting-ssh-connection.htm "If you're unable to connect to a compute instance using SSH, review the following troubleshooting error messages and suggestions to resolve the issue.").</div><div class="uk-alert uk-alert-warning" style="--uk-inverse: initial; outline: 0px; position: relative; margin-bottom: 20px; padding: 15px 29px 15px 15px; background: rgb(254, 245, 238); color: rgb(172, 78, 5); margin-top: 20px;"><span class="vl-1px-up uk-icon" style="--uk-inverse: initial; margin: 0px; border: none; border-radius: 0px; overflow: visible; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; font-family: inherit; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; color: inherit; text-transform: none; padding: 0px; background-color: rgba(0, 0, 0, 0); display: inline-block; fill: currentcolor; line-height: 0; position: relative; bottom: 1px;"><svg height="20" viewbox="0 0 20 20" width="20"><circle cx="10" cy="10" fill="none" r="9" stroke="#000"></circle><circle cx="10" cy="10" fill="none" r="5" stroke="#000"></circle><line fill="none" stroke="#000" stroke-width="1.1" x1="5.17" x2="8.11" y1="2.39" y2="5.33"></line><line fill="none" stroke="#000" stroke-width="1.1" x1="5.33" x2="2.39" y1="8.11" y2="5.17"></line><line fill="none" stroke="#000" stroke-width="1.1" x1="14.83" x2="11.89" y1="17.61" y2="14.67"></line><line fill="none" stroke="#000" stroke-width="1.1" x1="14.67" x2="17.61" y1="11.89" y2="14.83"></line><line fill="none" stroke="#000" stroke-width="1.1" x1="17.61" x2="14.67" y1="5.17" y2="8.11"></line><line fill="none" stroke="#000" stroke-width="1.1" x1="11.89" x2="14.83" y1="5.33" y2="2.39"></line><line fill="none" stroke="#000" stroke-width="1.1" x1="8.11" x2="5.17" y1="14.67" y2="17.61"></line><line fill="none" stroke="#000" stroke-width="1.1" x1="2.39" x2="5.33" y1="14.83" y2="11.89"></line></svg></span> **Tip**  
  
If you are using an older version of the Windows operating system, you can use PuTTY to create keys and connect to a Linux instance. For details on connecting to a Linux instance with PuTTY, see [Connecting to a Linux Instance from a Windows System Using PuTTY](https://docs.oracle.com/en-us/iaas/Content/Compute/Tasks/connect-to-linux-instance-from-windows-putty.htm#linux-from-windows-putty__connect-to-linux-from-windows-putty).</div></div></article>