Hi there,
First time user trying to get an SFTP storage type working. When I enter my credentials for the “Backup destination” and hit “Test connection” I get the following error: "Failed to connect: Invalid private key file. " I also get the following two errors in the “Log data from the server”:
Request for http://localhost:8200/api/v1/remoteoperation/test gave error
Renci.SshNet.Common.SshException: Invalid private key file.
at Renci.SshNet.PrivateKeyFile.Open(Stream privateKey, String passPhrase)
at Renci.SshNet.PrivateKeyFile..ctor(String fileName, String passPhrase)
at Duplicati.Library.Backend.SSHv2.ValidateKeyFile(String filename, String password)
at Duplicati.Library.Backend.SSHv2.CreateConnection()
at Duplicati.Library.Backend.SSHv2.List()
at Duplicati.Server.WebServer.RESTMethods.RemoteOperation.TestConnection(String url, RequestInfo info)
at Duplicati.Server.WebServer.RESTHandler.DoProcess(RequestInfo info, String method, String module, String key)
And:
Reporting error gave error
System.ObjectDisposedException: Cannot write to a closed TextWriter.
at System.IO.__Error.WriterClosed()
at System.IO.StreamWriter.Flush(Boolean flushStream, Boolean flushEncoder)
at Duplicati.Server.WebServer.RESTHandler.DoProcess(RequestInfo info, String method, String module, String key)
I do use keys to authenticate and under advanced options I did add an “ssh-keyfile”. I used the path to the keyfile that I use successfully with WinSCP to make a SFTP connection. I also have my keyfile encrypted and I did enter the password to decrypt it in the password field. I also tried the “ssh-key” option and just pasted the contents of the keyfile in along with “sshkey://” at the beginning as instructed.
I think the problem may be that the keyfile was generated with Putty and not directly with OpenSSH? I am not really sure how to correct this though.
Any tips are very much appreciated, thank you!