> For the complete documentation index, see [llms.txt](https://docs.mikopbx.com/mikopbx/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mikopbx.com/mikopbx/english/faq/troubleshooting/connecting-to-a-pbx-using-ssh/terminal.md).

# SSH Connection (Linux/MacOS Terminal)

Connecting to MikoPBX via SSH using Terminal (Linux/MacOS)

## Generating and Linking the Key

1. First, generate an SSH key. Open a terminal and enter the following command to create it:

```
ssh-keygen -t ed25519 -C "example.powershell@gmail.com"
```

In this example, an "ed25519" key will be generated with the comment "<example.powershell@gmail.com>" for future identification.

You can also specify a path where the key files will be saved. By default, keys are stored in `~/.ssh/id_ed25519.pub`. To set a custom path, add `-f` and specify it, for example:

```
ssh-keygen -t ed25519 -f ~/.ssh/my_new_key
```

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2Fz5uWdQClkpHTcdGvaZnZ%2FcreatedKeyPair.png?alt=media&amp;token=13f61618-fcb8-4f7a-a19f-9ff8b10d4b2a" alt=""><figcaption><p>Creating the SSH Keys (pair)</p></figcaption></figure>

{% hint style="info" %}
By default, the key is saved at `Username/.ssh/id_ed25519.pub on macOS or /home/Username/.ssh/id_ed25519.pub` on Linux.
{% endhint %}

2. Next, you need to retrieve and copy the newly created public key. Enter the command:

```
cat ~/.ssh/id_ed25519.pub
```

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2FwvvJo597YVQ2JqiADBW1%2FDisplayedKey.png?alt=media&amp;token=1971ccf4-0618-4830-93c9-b81c1bb7957a" alt=""><figcaption><p>Public key</p></figcaption></figure>

3. Open the MikoPBX web interface and go to **System** → **General Settings**:
4. Paste your public key into the **"SSH Authorized Keys"** field:

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2FRDlulHLP2Ej1Cmw3piUE%2FSshAuthorizedKeysField.png?alt=media&amp;token=5ed131db-c0ca-4c46-8a7b-90ddfbd8012d" alt=""><figcaption><p>SSH Authorized Keys Field</p></figcaption></figure>

## Connecting via SSH

To connect via SSH, run the following command in your terminal:

```
ssh -i ~/.ssh/id_ed25519 root@mikopbxipadress
```

Replace the following with your actual parameters:

* The path to your SSH key (if different from default).
* The IP address of your MikoPBX in place of `mikopbxipadress`.

Upon successful authentication, you will be connected to the MikoPBX console via SSH:

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2FuU05yYaBwsMBS3pQRLbm%2FmikopbxconsoleSSH.png?alt=media&amp;token=2e90a52d-c391-4179-b600-ebed3f5920e5" alt=""><figcaption><p>Successful connection!</p></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.mikopbx.com/mikopbx/english/faq/troubleshooting/connecting-to-a-pbx-using-ssh/terminal.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
