Import from Kitty

This article describes how to import data from Kitty Portable.

For that you'll need to:

  1. Convert data from Kitty Portable into an ssh config file.

Convert from Kitty Portable

Windows PowerShell
Windows PowerShell
$PSDefaultParameterValues['Out-File:Encoding'] = 'utf8'
Get-ChildItem .\Sessions\ | Foreach-Object {
echo "Host $_.Name"
$content = Get-Content $_.FullName
$content | where { $_ -match '(^PortNumber)|(^HostName)|(^UserName)\\' } | %{ $_ -replace 'PortNumber',' Port' -replace 'HostName',' Hostname' -replace 'UserName',' User' -replace '\\', ' '}
} > ssh_config
for i in $(ls Sessions); do
echo "Host $i"
grep -e '^PortNumber\\' -e '^HostName\\' -e '^UserName\\' Sessions/$i \
| sed -e 's/HostName/ Hostname/g' \
-e 's/PortNumber/ Port/g' \
-e 's/UserName/ User/g' \
-e 's,\\, ,g'
done > ssh_config

That script reads the ‘Sessions’ directory generated by Kitty Portable and generates a ssh_config file.