> 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/faq/troubleshooting/connecting-to-a-pbx-using-ssh/powershell.md).

# Подключение с помощью SSH (Windows)

Подключение к MikoPBX по SSH с помощью Powershell (OpenSSH)

## Создание и привязка ключа

Для начала необходимо произвести установку OpenSSH. Сделать это можно [по ссылке](https://github.com/PowerShell/Win32-OpenSSH/releases).

1. После установки необходимо проверить ее корректность. Для этого введите следующую команду в Powershell:

```
ssh -V
```

У Вас должна отобразиться версия OpenSSH:

<figure><img src="https://3704471835-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MPK4TuzRBnP7rt8htho-887967055%2Fuploads%2F44W0gCuJsyIqMqQXlkjF%2FOpenSSHVersion.png?alt=media&amp;token=83baafb8-a43d-43e0-84c1-fb9e3090bc78" alt=""><figcaption><p>Версия OpenSSH</p></figcaption></figure>

{% hint style="info" %}
В случае, если при вводе команды для проверки версии ничего не произошло, Вы можете ввести - `Add-WindowsCapability -Online -Name OpenSSH.Client*`
{% endhint %}

2. Далее необходимо сгенерировать SSH ключ, для этого введем следующую команду:

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

В данном случае будет сгенерирован ключ типа "ed25519" с комментарием "<example.powershell@gmail.com>" - это поможет идентифицировать его в будущем.

Помимо этого, можно указать путь, куда будет сохранён файл с ключами, по умолчанию это\
"**C:\Users\<Username>.ssh\id\_ed25519**". Для этого добавьте -f и укажите путь, например:

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

<figure><img src="https://3704471835-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MPK4TuzRBnP7rt8htho-887967055%2Fuploads%2Fjd7MErLk91TdwLkD2LZs%2FcreatedKeyTerminal.png?alt=media&amp;token=d51055c0-7678-46fd-9f24-73f333455711" alt=""><figcaption><p>Создание ключа в Powershell</p></figcaption></figure>

После этого, ключ будет создан в указаной директории. В одном файле будет располагаться публичный ключ, а в другом - приватный.

<figure><img src="https://3704471835-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MPK4TuzRBnP7rt8htho-887967055%2Fuploads%2FNrQk2DgxFNviLvLAstI7%2FleysInTheFolder.png?alt=media&amp;token=e8bd0683-85bb-4c52-ade8-fe98e64d1a07" alt=""><figcaption><p>Созданные ключи</p></figcaption></figure>

3. Введем команду для получения публичного Ssh-ключа:

```
Get-Content ~/.ssh/id_ed25519.pub
```

Скопируйте его.

4. Перейдите в web-интерфейс MikoPBX, во вкладку "**Система**" -> "**Общие настройки**":

<figure><img src="https://3704471835-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MPK4TuzRBnP7rt8htho-887967055%2Fuploads%2Fgit-blob-ca8d56381a046731d355e856879b4f6a10d79422%2FgeneralSettingsSection.png?alt=media" alt=""><figcaption><p>Раздел "<strong>Общие настройки</strong>"</p></figcaption></figure>

5. Перейдите в раздел "**SSH**" и вставьте публичный ключ в поле "**SSH Authorized Keys**" в формате:

```
Тип ключа
Ключ
```

Нажмите "**Сохранить**":

<figure><img src="https://3704471835-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MPK4TuzRBnP7rt8htho-887967055%2Fuploads%2FVQ2WIW37yz353moPTI6K%2FsshAuthorizedKeysField.png?alt=media&amp;token=c316945d-6d74-49c4-97b4-e5a3c4402c8f" alt=""><figcaption><p>Поле "<strong>SSH Authorized Keys</strong>"</p></figcaption></figure>

## Подключение с помощью SSH

Для подключения по SSH выполните следующую команду в Powershell:

```
ssh -i C:\Users\<Username>\.ssh\id_ed25519 root@mikopbxipadress
```

Замените следующие данные, исходя из ваших параметров:

* Путь к SSH ключу.
* Подставьте IP вашей MikoPBX вместо *mikopbxipadress.*

Произойдет подключение к консоли MikoPBX с помощью SSH:

<figure><img src="https://3704471835-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MPK4TuzRBnP7rt8htho-887967055%2Fuploads%2Fgit-blob-9305cb84df7a471b4f1d287ed276b397baa204ab%2FmikopbxconsoleSSH.png?alt=media" alt=""><figcaption><p>Успешное подключение!</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/faq/troubleshooting/connecting-to-a-pbx-using-ssh/powershell.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.
