SSH Config Import

By importing sshconfig, you can instantly add a lot of hosts and related data.

Follow the instruction below to learn how.

SSH Config Import is currently available in the desktop app only.

SSH Config Import is a Premium feature.

Desktop
  1. Make sure you use Termius 4.4.x or newer.

  2. From the top left menu choose Profile.

  3. Click Import SSH Config and select the config file.

  4. Tick the hosts you’d like to import (see the picture below).

  5. Click root group, if want the hosts to be added into a group.

  6. Click Save and Done.

Importing from ~/.ssh/config

How It's Done

  • Parameters not present on the + Host screen will be ignored.

  • ProxyCommand is ignored.

  • JumpHost is treated as an item in the host chain.

  • IdentityFile is ignored for apps running in the sandbox (Apple / Windows stores).

Current Limitations

At the moment the SSH Config feature works well with around 500 hosts per file. If your ssh config is larger than that, you can split it into several files.

Split a Large SSH Config

Before running one of the scripts below, substitute ssh_config with the name of your ssh config file.

Linux
Windows (PowerShell)
awk '/^Host / { ++hosts; if (hosts % limit == 0) print "# import limit"} {print $0 }' \
hosts=0 limit=500 ssh_config \
| split -p '# import limit' - ssh_config-

That script generates multiple files using the ssh_config-xx pattern. E.g. ssh_config-aa, ssh_config-ab.

$PSDefaultParameterValues['Out-File:Encoding'] = 'utf8'
$host_count=0; $filename=0;
Get-Content .\ssh_config | %{
if ($_ -match 'Host ') {[int]$host_count+=1};
if ($host_count % 500 -eq 0 -and $_ -match 'Host ') { [int]$filename+=1 };
echo $_ >> "ssh_config-$filename"
};

This script generates several files with pattern ssh_config-\d. E.g. ssh_config-0, ssh_config-1.