Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: I can´t connect with private key without password

Nacho wrote:

Now i need a dll that works find with 32 bit

WinSCP .NET assembly works both in 32 and 64-bit.
Nacho

Re: I can´t connect with private key without password

martin wrote:

Well, so do what the message says.
Set the SessionOptions.SshHostKeyFingerprint.
https://winscp.net/eng/docs/library_sessionoptions#sshhostkeyfingerprint

If you can login in GUI, it can generate a working code template for you:
https://winscp.net/eng/docs/ui_generateurl#code


Thank you!! i scan figerprint and add to SessionOptions.SshHostKeyFingerPrint and it works perfectly, Now i need a dll that works find with 32 bit
Nacho

I can´t connect with private key without password

Hi,

I trying to connect SFTP with ppk file without password with .net assembly with session options c#,this is my code

     SessionOptions sessionOptions = new SessionOptions();

     sessionOptions.Protocol = Protocol.Sftp;
     sessionOptions.HostName = "xxx.xxx.xxx.xxx";
     sessionOptions.PortNumber = 22;
     sessionOptions.UserName = "user";
     sessionOptions.SshPrivateKeyPath = path

     using (Session session = new Session())
     {
        try
        {
            session.Open(sessionOptions);
        }
        catch (Exception ex)
        {
            MessageBox.Show(ex.Message);
        }
     }

The message I receive when trying is : "SessionOptions.Protocol is Protocol.Sftp or Protocol.Scp, but SessionOptions.SshHostKeyFingerprint is not set"

I try to connect with the graphical interface with the same configuration and it works at the first.

Some suggestion?

Thanks!!!!