Unable to fetch files after opening session using private key.
Hi,
I have a c# project in which we connect winscp using private key in following manner
where "winscpSSHPrivateKeyPath" is basically ppk full path. Also though we are able to connect & even open session, but when we try to check our remote files using following code
it always gives error of unable to find path.
Hence we tried opening session using username & password using same above code. And it all worked, we were even able to retrieve files & even put files. but it is not possible when we try to open using private key.
Can some one please help us if we are missing something.
regards.
I have a c# project in which we connect winscp using private key in following manner
SessionOptions sessionOptions = new SessionOptions { Protocol = Protocol.Sftp, HostName = hostName, UserName = userName, SshHostKeyFingerprint = sshHostKeyFingerprint, }; LogHelper.Log("Placing credentials " + DateTime.Now); if (isPasswordBased == 0) sessionOptions.SshPrivateKeyPath = winscpSSHPrivateKeyPath; else sessionOptions.Password = password;
where "winscpSSHPrivateKeyPath" is basically ppk full path. Also though we are able to connect & even open session, but when we try to check our remote files using following code
session.ListDirectory("\")
Hence we tried opening session using username & password using same above code. And it all worked, we were even able to retrieve files & even put files. but it is not possible when we try to open using private key.
Can some one please help us if we are missing something.
regards.