Import from WinSCP

This article describes how to import data from WinSCP.

For that you'll need to:

  1. Export the data from WinSCP through 'Export/Backup configuration' (learn more).

  2. Convert the exported file to an ssh config file (see below).

Convert from WinSCP

Windows Powershell
Windows Powershell
$PSDefaultParameterValues['Out-File:Encoding'] = 'utf8'
cat .\WinSCP.ini |
where { $_ -match '(HostName=)|(UserName=)|(PortNumber=)|(PublicKeyFile=)|(Sessions\\)' } |
%{ $_ -replace '\[Sessions\\(.*)\]', 'Host "$1"' } |
%{ $_ -replace 'HostName=',' HostName ' -replace 'UserName=',' User ' -replace 'PortNumber=',' Port ' -replace 'PublicKeyFile=(.*)',' IdentifyFile "$1"' } |
%{ [uri]::UnescapeDataString($_)
}>ssh_config

Substitute '.\WinSCP.ini' with the location of the file created by WinSCP.