Import from MobaXterm
This article describes how to import data (sessions) from MobaXterm.
For that you'll need to:
    1.
    Export the data from MobaXterm as described here.
    2.
    Convert the exported file to an ssh config file (see below).

Convert from MobaXterm

Windows PowerShell
1
$PSDefaultParameterValues['Out-File:Encoding'] = 'utf8'
2
$output=switch -regex -file '.\MobaXterm Sessions.mxtsessions'
3
{
4
"SubRep=(.*)" { $folder=$matches[1] }
5
"(.+)\s*=\s*#109#0%([^%]*)%(\d+)%([^%]*)%[^%]*%[^%]*%[^%]*%[^%]*%[^%]*%[^%]*%[^%]*%[^%]*%[^%]*%[^%]*%([^%]*)(%.*)?" {
6
$name=$matches[1]; $hostname=$matches[2]; $port=$matches[3]; $user=$matches[4]; $ssh_key=$matches[5];
7
if ($hostname) {
8
"Host `"$folder\$name`""
9
" Hostname $hostname"
10
if ($user) { " User $user" }
11
if ($port) { " Port $port" }
12
if ($ssh_key.Trim()) { " IdentityFile $ssh_key" }
13
}
14
}
15
}
16
$output > ssh_config
Copied!
Substitute '.\MobaXterm Sessions.mxtsessions' with the location of the file created by MobaXterm.
Last modified 1yr ago
Copy link