This project has moved. For the latest updates, please go here.

Public Key Authentication Issues

Jun 6, 2014 at 8:53 AM
I’ve been trying to connect to a remote ssh server using public key authentication with the SFTP adapters and was unable to, I then installed BitVise SSH server on my local machine and attempted to connect to that instead but I am faced with the same error or at least it looks like the same error:

Method: Blogical.Shared.Adapters.Sftp.SharpSsh.Sftp.Dir

Error: Unable to connect to Sftp host [localhost]

Information:
Type: System.Exception
Target: Void connect(Boolean)
Message: Unable to connect to Sftp host [localhost]
Stacktrace:
at Blogical.Shared.Adapters.Sftp.SharpSsh.Sftp.connect(Boolean force)
at Blogical.Shared.Adapters.Sftp.SharpSsh.Sftp.reConnect()

at Blogical.Shared.Adapters.Sftp.SharpSsh.Sftp.Dir(String fileMask, String uri, ArrayList filesInProcess, Boolean trace)

Type: Tamir.SharpSsh.jsch.JSchException
Target: Void connect(Int32)
Message: Auth fail
Stacktrace:
at Tamir.SharpSsh.jsch.Session.connect(Int32 connectTimeout)
at Tamir.SharpSsh.SshBase.ConnectSession(Int32 tcpPort)
at Tamir.SharpSsh.SshBase.Connect(Int32 tcpPort)
at Blogical.Shared.Adapters.Sftp.SharpSsh.Sftp.connect(Boolean force)

Looking at the exception I then downloaded the Source code for the Tamir assemblies, called it from a console app and it looks like the actual error being caught is :

Tamir.SharpSsh.jsch.JSchException: SSH_MSG_DISCONNECT: 11 en
at Tamir.SharpSsh.jsch.Session.read(Buffer buf) Sessi
on.cs:line 848

Using external clients Bitwise Tunnilier and WinSCP I can connect to my local and the remote servers successfully using my private key.
Jun 6, 2014 at 1:54 PM
The keys generated with PuttyGen did not seem to work even after exporting the SSH key so i instead I used GitHub. Those Putty generated keys do however work on three different sftp clients like Putty, Bitwise Tunnilier and WinSCP!?!

So my problem is solved by using a key generated through GitHub.
Marked as answer by nigelsheldon on 6/6/2014 at 6:54 AM