In Power Automate Desktop, when you use a private key file as an authentication method in the Open secure FTP connection action, you may receive the following error message:
Error message: “Can’t connect to ServerHost”.
More error details: "Robin.Core.ActionException: Can’t connect to ServerHost ---> Renci.SshNet.Common.SshException: Invalid private key file".
Here ServerHost is the FTP server host address used in the action.
This error can occur if the format of the private key file is not using OpenSSH format. Power Automate Desktop explicitly checks that the private key file format is OpenSSH, where the key should start with:
---- BEGIN ___ PRIVATE KEY ----
To correct the private key file format (OpenSSH Format), make sure that the text in the file looks similar to the following:
----BEGIN ___ PRIVATE KEY----
----END ___ PRIVATE KEY----
You can also use PuTTY Key Generator (PuttyGen.exe) to convert the key file to the OpenSSH format. To do that:
Load your existing private key file in PuTTY Key Generator.
Click Conversions > Export OpenSSH key (not the "force new file format" option).