---
description: Connecting via SSH from the Command Line on macOS or Linux using a Key Pair
---

# MacOS/Linux using Key Pairs

## Prerequisite

* An instance created with key pair authentication ([see launch instance steps](../launching-compute-instance)).
* The private key file from the key pair.

## Instructions

### 1. **Log in to the project**

Select a project from the projects management page to enter the project detail page.

![Project Detail](https://content.gitbook.com/content/4csDFrNQz0Q4tDnx3xyT/blobs/7oGExTUMo2GZ08TTj4Jw/staging-project-detail.png)

### 2. **Go to the Instances page**

In the left-hand menu, click **COMPUTE > Instances** to go to the instance page.

![Instances List](https://content.gitbook.com/content/4csDFrNQz0Q4tDnx3xyT/blobs/CColRW5rJz1pqH3jai4r/staging-instances-list.png)

### 3. **Go to the Instance Detail page**

Click on the desired instance from the list to enter its detail page.

![Instance Detail](https://content.gitbook.com/content/4csDFrNQz0Q4tDnx3xyT/blobs/kK4INi03NSntWResCsEa/staging-instance-detail.png)

### 4. **Check the External IP**

Note the external IP of the instance and check the SSH settings under Networks & Security Groups.

![Instance External IP](https://content.gitbook.com/content/4csDFrNQz0Q4tDnx3xyT/blobs/P9oojaqoDGMnugQZu9Wy/staging-external-ip.png)

### 5. **Open the Terminal application**

Launch the Terminal program on your macOS or Linux system.

![Terminal](https://content.gitbook.com/content/4csDFrNQz0Q4tDnx3xyT/blobs/WT8pa67j7VclboodqlRS/terminal.png)

### 6. **Run the SSH command**

Enter the following SSH command:

```
ssh -i /path/to/your/keypair nc-user@INSTANCE_EXTERNAL_IP
```

Replace `/path/to/your/keypair` with the path to your key pair file and `INSTANCE_EXTERNAL_IP` with your instance's External IP address.

{% hint style="warning" %}
If you are unable to connect, you may need to set the permissions for your key pair file to "600". You can do this with the following command:

`chmod 600 /path/to/your/keypair`
{% endhint %}

![Secure Shell using Key Pair](https://content.gitbook.com/content/4csDFrNQz0Q4tDnx3xyT/blobs/bhLu85clGvUcFK2HRPrB/ssh-success.png)
