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

c10c

found solution...

_options.Protocol = Protocol.Sftp;
_options.HostName = "acetrax.upload.akamai.com";
_options.PortNumber = 22;
_options.UserName = "sshacs";
_options.SshHostKey = "ssh-rsa 1024 e0:4e:b5:73:79:26:5e:a2:7c:85:58:03:ac:4e:db:e3";
_options.SshPrivateKey = @"C:\Users\chiragc\Desktop\Net Storage\netstorage_pk.ppk";

Thanks for making me ponder on debug file :)
c10c

Disconnected: No supported authentication methods available

Hi,

I am writing the following code to connect to my sFTP server

public sFTP()
{
_session = new Session();
_session.DebugLogPath = @"E:\Logs\WINSCP_Debuglog.txt";
_session.SessionLogPath = @"E:\Logs\WINSCP_Sessionlog.txt";
_session.DisableVersionCheck = true;
_session.DefaultConfiguration = false;
_session.Open(Initialize());

}

private SessionOptions Initialize() /* values hidden for confidentiality */
{
_options = new SessionOptions();
_options.Protocol = Protocol.Sftp;
_options.HostName = "xx.xx.xx.com";
_options.PortNumber = 22;
_options.UserName = "xxxxx";
_options.SshHostKey = "ssh-rsa 1024 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx";
return _options;
}

But, everytime it gives me the error in the subject, do i need to supply the private key (PPK) also?

Please help