arrow-left

All pages
gitbookPowered by GitBook
1 of 5

Loading...

Loading...

Loading...

Loading...

Loading...

Connecting to the PBX using SSH

Overview of methods for connecting to a PBX using SSH

SSH (Secure Shell) is a protocol used for secure remote connections and server management. It allows you to run commands, transfer files, and administer systems through an encrypted channel. SSH protects your data from interception by providing authentication and encryption between the client and the server. It is a primary tool for developers, system administrators, and DevOps engineers when working with remote machines.

SSH connection

Below are three different methods for connecting to MikoPBX via the SSH protocol:

  • Password-based connection using third-party applications (this article uses PuTTY as an example)

  • Key-based connection, demonstrated with examples on Windows, Linux (MacOS)

  • Connection using Google Secure Shell Extension.




SSH Conenction (SSH Client - Putty)chevron-right
SSH Connection (Windows Powershell)chevron-right
SSH Connection (Linux/MacOS Terminal)chevron-right
SSH Connection (Google Secure Shell)chevron-right

SSH Connection (Linux/MacOS Terminal)

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

hashtag
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 "[email protected]"

In this example, an "ed25519" key will be generated with the comment "[email protected]envelope" 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:

circle-info

By default, the key is saved at Username/.ssh/id_ed25519.pub on macOS or /home/Username/.ssh/id_ed25519.pub on Linux.

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

  1. Open the MikoPBX web interface and go to System → General Settings:

  2. Paste your public key into the "SSH Authorized Keys" field:

hashtag
Connecting via SSH

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

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:

ssh-keygen -t ed25519 -f ~/.ssh/my_new_key
cat ~/.ssh/id_ed25519.pub
ssh -i ~/.ssh/id_ed25519 root@mikopbxipadress
Creating the SSH Keys (pair)
Public key
SSH Authorized Keys Field
Successful connection!

SSH Connection (Windows Powershell)

Connecting to MikoPBX via SSH using PowerShell (OpenSSH)

hashtag
Generating and Linking the Key

To begin, you need to install OpenSSH on Windows. You can do this from this linkarrow-up-right.

  1. After installation, verify it by entering the following command in PowerShell:

ssh -V

You should see the OpenSSH version displayed:

circle-info

If nothing happens when checking the version, you can run:

Add-WindowsCapability -Online -Name OpenSSH.Client*

  1. Next, generate an SSH key by entering the following command:

This will generate an "ed25519" key with the comment "" to identify it. You can specify a path for the keys by adding -f and a path, for example:

After this, the key pair will be created in the specified directory. One file will contain the public key, and the other the private key.

  1. Run the following command to retrieve the public SSH key:

Copy the public key from the output.

  1. Open the MikoPBX web interface and go to "System" → "General Settings":

  1. Navigate to the SSH section and paste the public key into the "SSH Authorized Keys" field in the following format:

Click "Save settings":

hashtag
Connecting via SSH

To connect via SSH, run the following command in PowerShell:

Replace the following based on your parameters:

  • The path to your SSH key.

  • The IP address of your MikoPBX instead of mikopbxipadress.

You will then be connected to the MikoPBX console via SSH:

SSH Conenction (SSH Client - Putty)

This tutorial will describe how to connect via SSH using Putty

  1. Download the program to connect via SSH. This can be done on the official website at the

  2. Run the downloaded program. The main menu will open for you.

[email protected]envelope
OpenSSH version
Generating a Key in Powershell
Generated keys (pair)
"General settings" section
"SSH Authorized Keys" field
Successful connection!
ssh-keygen -t ed25519 -C "[email protected]"
ssh-keygen -t ed25519 -f ~/.ssh/my_new_key
Get-Content ~/.ssh/id_ed25519.pub
KeyType KeyData
ssh -i C:\Users\<Username>\.ssh\id_ed25519 root@mikopbxipadress
Go to the "Connection" - "Data" section
  1. "Auto-login username" specify root

"Terminal-tipe string" specify xterm-256color

  1. Go to the "Translation" section

  1. «Remote character set» - specify UTF-8

    Set the flag «Enable VT100 line drawing even in UTF-8 mode»

  1. Go to the section "Session" - "Logging". Here you can configure saving the output to a file:

  1. Go to the "Session" section

  1. Required data:

  • Host Name (or IP address) — IP address of the PBX

  • Port — port for SSH connection by default 22

  • Enter the session name and save its settings

  1. In the future, use the "Load" action to use the previously saved session

  1. Perform the "Open" action to connect to the PBX and enter the SSH password

  1. Before connecting, you need to allow password authorization in the MikoPBX web interface, as well as set a password for connection: to do this, go to "General Settings" -> "SSH"

  1. After entering the SSH password, the PBX menu will open

  1. To open the console, go to "[9] Console(Shell)"

linkarrow-up-right

SSH Connection (Google Secure Shell)

SSH Connection using Google Secure Shell

circle-info

This method is available if you use Google Chrome for connection to the MikoPBX web interface.

hashtag
Enabling password access

  1. Go to the "System" -> "General Settings" section.

  1. Go to the "SSH" section. Toggle the "Disable password logins" switch (switch is enabled by default). Set your password for the SSH connection. Save the settings.

triangle-exclamation

Do not use weak passwords! Always disable password-based SSH connections after you log out!

hashtag
Connection using Google Secure Shell

  1. In the MikoPBX Web-interface, go to "Maintenance" -> "SSH console".

  1. If you don't have the "Secure Shell" browser extension installed, you will be redirected to the extension store. Click "Add to Chrome." After installation is complete, return to the web interface and repeat Step 1.

  1. After redirecting to the Google Secure Shell tab, enter "yes" in the dialog box for a new connection. Press "Enter."

  1. In the new dialog box, enter the previously set SSH password. Press "Enter."

An SSH connection will be established. 🎉

"System" - "General settings" section
Password-based access
"Maintenance" -> "SSH Console" section
Installing extension
Dialog box #1
Dialog box #2
Successful SSH connection