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)
In this example, an "ed25519" key will be generated with the comment "[email protected]" 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:
By default, the key is saved at Username/.ssh/id_ed25519.pub on macOS or /home/Username/.ssh/id_ed25519.pub on Linux.
Next, you need to retrieve and copy the newly created public key. Enter the command:
Open the MikoPBX web interface and go to System → General Settings:
Paste your public key into the "SSH Authorized Keys" field:
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)
Generating and Linking the Key
To begin, you need to install OpenSSH on Windows. You can do this from this link.
After installation, verify it by entering the following command in PowerShell:
ssh -V
You should see the OpenSSH version displayed:
If nothing happens when checking the version, you can run:
Set the flag «Enable VT100 line drawing even in UTF-8 mode»
Go to the section "Session" - "Logging". Here you can configure saving the output to a file:
Go to the "Session" section
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
In the future, use the "Load" action to use the previously saved session
Perform the "Open" action to connect to the PBX and enter the SSH password
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"
After entering the SSH password, the PBX menu will open
This method is available if you use Google Chrome for connection to the MikoPBX web interface.
Enabling password access
Go to the "System" -> "General Settings" section.
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.
Do not use weak passwords! Always disable password-based SSH connections after you log out!
Connection using Google Secure Shell
In the MikoPBX Web-interface, go to "Maintenance" -> "SSH console".
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.
After redirecting to the Google Secure Shell tab, enter "yes" in the dialog box for a new connection. Press "Enter."
In the new dialog box, enter the previously set SSH password. Press "Enter."