Import from WinSCP
This article describes how to import data from WinSCP.
For that you'll need to:
    1.
    Export the data from WinSCP via 'Export/Backup configuration'.
    2.
    Convert the exported file to an ssh config file (see below).

Convert from WinSCP

Windows Powershell
1
$PSDefaultParameterValues['Out-File:Encoding'] = 'utf8'
2
cat .\WinSCP.ini |
3
where { $_ -match '(HostName=)|(UserName=)|(PortNumber=)|(PublicKeyFile=)|(Sessions\\)' } |
4
%{ $_ -replace '\[Sessions\\(.*)\]', 'Host "$1"' } |
5
%{ $_ -replace 'HostName=',' HostName ' -replace 'UserName=',' User ' -replace 'PortNumber=',' Port ' -replace 'PublicKeyFile=(.*)',' IdentifyFile "$1"' } |
6
%{ [uri]::UnescapeDataString($_)
7
}>ssh_config
Copied!
Substitute '.\WinSCP.ini' with the location of the file created by WinSCP.
Last modified 9mo ago
Copy link