none
Unable to connect to SFTP host using Identity file RRS feed

  • Question

  • Hi,

    I am using codeplex SFTP Adapter. I have tested the connectivity of my SFTP Host from test environment with FileZilla using private key file and I am able to connect it successfully. As the SFTP Adapter wont support Private Key file, I have converted it into OpenSSH format using PuTTYGen.exe and used it in the SFTP Adapter.

    But I am receiving the below error:

    Type: Tamir.SharpSsh.jsch.JSchPartialAuthException
    Target: Void connect(Int32)
    Message: USERAUTH fail (51). Unable to connect to the host using the [xxxxx] user.
    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)

    I am unable to find the rootcause for the same.

    Request you to suggest me the solution for the same

    Thanks in Advance

    Raghuram
    Tuesday, January 15, 2013 10:02 AM

All replies

  • Hi,

    Most likely root cause is your keys are incorrect.  Check the following to see if you are creating the OpenSSH keys in the correct format.

    Creating OpenSSH formatted keys

    Thanks,

    William

    Tuesday, January 15, 2013 10:30 AM
  • Hi William,

    Thanks for your suggestion.

    But I am unable to find the .ssh folder in my server to copy my exported private key as per article.

    Also I am unable to find ssh-keygen to convert it to RFC 4716 version of OpenSSH format.

    Request you to suggest me.

    Thanks in Advance

    Raghuram

    Wednesday, January 16, 2013 7:24 AM
  • Hi William,

    I have followed the conversion steps as mentioned in the links above.

    When I am using Identity File and Password in the SFTP Adapter i am getting the error "USERAUTH failed(51)"

    If I use only Identity file by resetting the password in SFTP Adapter i am getting below error:

    Method: Blogical.Shared.Adapters.Sftp.SftpReceiverEndpoint.EndpointTask
    Error: Uri:SFTP://neteftp.nestpensions.org.uk:9039/chris.perryman/*.xml

    ------------------------------
    Information:
    Type: System.Exception
    Target: 
    Message: Uri:SFTP://neteftp.nestpensions.org.uk:9039/chris.perryman/*.xml
    Stacktrace:


    ------------------------------
    Type: System.Exception
    Target: Void connect(Boolean)
    Message: Unable to connect to Sftp host [neteftp.nestpensions.org.uk]
    Stacktrace:
       at Blogical.Shared.Adapters.Sftp.SftpReceiverEndpoint.PickupFilesAndSubmit()
       at Blogical.Shared.Adapters.Sftp.SftpReceiverEndpoint.EndpointTask()


    ------------------------------
    Type: Tamir.SharpSsh.jsch.JSchPartialAuthException
    Target: Void connect(Int32)
    Message: password,publickey,keyboard-interactive
    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)


    Request you to help on the same.

    Wednesday, January 16, 2013 12:07 PM
  • You need to either use the password or the identity key don't try to use both.

    Please mark the post answered your question as answer, and mark other helpful posts as helpful, it'll help other users who are visiting your thread for the similar problem, Regards -Rohit Sharma (http://rohitt-sharma.blogspot.com/)

    Thursday, January 17, 2013 5:00 AM
    Moderator
  • Hi,

    It appears there is an issue with the identify file. 

    http://sftpadapter.codeplex.com/discussions/220746

    I would try to debug though the code.  (The code for the adapter is available for download)

    Thanks,

    William

    Thursday, January 17, 2013 6:36 AM
  • Hi,


    Thanks for the suggestions.

    I have tried key based authentication and password based authentication seperately but still i have received same error

    When I use only identity file without password I have got below error:

    Message:publickey,password,KeyBoardInteractive unable to connect to sftp host

    So Now I have tried \n software SFTP Adapter using password and public key seperately, but i have received below error:

    Event ID: 5740

    The adapter "nsoftware.SFTP v3" raised an error message. Details "Receive operation failed for SFTP receive location "SFTP://xxxxx:xx/xxx/*.*": Error downloading SFTP messages: Encountered error while waiting for packet: remote end disconnected.".

    The problem is when I am using .ppk private key with SFTP clients like FileZilla and WinScp I am able to connect to SFTP server.

    But when I am converting this file to OpenSSH format using PuTTYGen for BizTalk SFTP Adapter it is giving me errors.

    Request you to suggest me the solution for the same.

    Thanks in Advance.

    Raghuram

    Thursday, January 17, 2013 7:35 AM