Rebex.Net.SftpException: Key exchange failed. Requested service is not implemented

+1 vote
asked Jul 12, 2016 by Ritesh (290 points)

I am not able to connect to the SFTP server. I am getting the error messages as "Rebex.Net.SftpException: Key exchange failed. Requested service is not implemented. ---> Rebex.Net.SshException: Key exchange failed. Requested service is not implemented."

But when I connect using the FileZilla FTP client it works fine. Could you please help me out on this.

Many Thanks

Applies to: Rebex SFTP

1 Answer

0 votes
answered Jul 12, 2016 by Lukas Matyska (38,400 points)

Can you please ensure that you are using FileZilla with SFTP protocol and not the FTP protocol?

If you are using really SFTP, please let us know.

If you are using FTP, please use the Rebex FTP/SSL component (instead of Rebex SFTP).

commented Jul 12, 2016 by Ritesh (290 points)
Yes, I am using SFTP protocol with FileZilla. The rebex SFTP protocol was working fine till couple of days back. All of sudden I am getting the message "Rebex.Net.SshException: Key exchange failed. Requested service is not implemented."

I am using the following code and it has been working fine till two days back.

 Dim SFTPclient As New Sftp()
            If Not SFTPclient.State = SftpState.Connected Then
                SFTPclient.Connect(ConfigurationManager.AppSettings("Host"))
                SFTPclient.Login(ConfigurationManager.AppSettings("Username"), ConfigurationManager.AppSettings("Password"))
                SFTPclient.GetFiles(ConfigurationManager.AppSettings("RemotePath"), ConfigurationManager.AppSettings("LocalDirPath"), SftpBatchTransferOptions.Default, SftpActionOnExistingFiles.SkipAll)
            End If
commented Jul 12, 2016 by Lukas Matyska (38,400 points)
Can you please send us log of the communication of both Rebex and FileZilla? We will compare it and let you know what to do.

Using Rebex, the log can be created like this:

    Dim SFTPclient As New Sftp()
    SFTPclient.LogWriter = New Rebex.FileLogWriter("c:\logs\sftp.txt", Rebex.LogLevel.Debug)
commented Jul 12, 2016 by Ritesh (290 points)
Please see below the log

2016-07-12 15:58:29.506 Opening log file.
2016-07-12 15:58:32.681 INFO Sftp(1) Info: Connecting to test.test.co.uk:22 using Sftp 2.0.3854.0.
2016-07-12 15:58:34.032 DEBUG Sftp(1) SSH: Server is 'SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu1'.
2016-07-12 15:58:34.137 DEBUG Sftp(1) SSH: Negotiation started.
2016-07-12 15:58:34.775 DEBUG Sftp(1) SSH: Group exchange.
2016-07-12 15:58:35.055 DEBUG Sftp(1) SSH: Negotiation failed: Rebex.Net.SshException: Key exchange failed. Requested service is not implemented. ---> Rebex.Net.SshException: Requested service is not implemented.
   at Rebex.Net.SshSession.cqLugQ(Byte[] , Int32 , Int32 )
   at Rebex.Net.SshSession.AapcLiZ(Byte[] , Int32 , Int32 )
   at Rebex.Net.SshSession.cDtmAOZ(Int64& , Boolean )
   at Rebex.Net.SshSession.CFLiXJ(ANiLIV )
   at wWGvS.CLJmsVZ.ArwjUr(SshSession , Byte[] , Byte[] , Byte[] , Byte[] , Byte[]& , Byte[]& , Byte[]& )
   at Rebex.Net.SshSession.ArwjUr(Byte[] )
   --- End of inner exception stack trace ---
   at Rebex.Net.SshSession.ArwjUr(Byte[] )
2016-07-12 15:58:35.066 ERROR Sftp(1) SSH: Rebex.Net.SshException: Key exchange failed. Requested service is not implemented. ---> Rebex.Net.SshException: Requested service is not implemented.
   at Rebex.Net.SshSession.cqLugQ(Byte[] , Int32 , Int32 )
   at Rebex.Net.SshSession.AapcLiZ(Byte[] , Int32 , Int32 )
   at Rebex.Net.SshSession.cDtmAOZ(Int64& , Boolean )
   at Rebex.Net.SshSession.CFLiXJ(ANiLIV )
   at wWGvS.CLJmsVZ.ArwjUr(SshSession , Byte[] , Byte[] , Byte[] , Byte[] , Byte[]& , Byte[]& , Byte[]& )
   at Rebex.Net.SshSession.ArwjUr(Byte[] )
   --- End of inner exception stack trace ---
   at Rebex.Net.SshSession.ArwjUr(Byte[] )
   at Rebex.Net.SshSession.bOtYJuZ()
   at Rebex.Net.SshSession.Negotiate()
2016-07-12 15:58:35.074 ERROR Sftp(1) Info: Rebex.Net.SshException: Key exchange failed. Requested service is not implemented. ---> Rebex.Net.SshException: Requested service is not implemented.
   at Rebex.Net.SshSession.cqLugQ(Byte[] , Int32 , Int32 )
   at Rebex.Net.SshSession.AapcLiZ(Byte[] , Int32 , Int32 )
   at Rebex.Net.SshSession.cDtmAOZ(Int64& , Boolean )
   at Rebex.Net.SshSession.CFLiXJ(ANiLIV )
   at wWGvS.CLJmsVZ.ArwjUr(SshSession , Byte[] , Byte[] , Byte[] , Byte[] , Byte[]& , Byte[]& , Byte[]& )
   at Rebex.Net.SshSession.ArwjUr(Byte[] )
   --- End of inner exception stack trace ---
   at Rebex.Net.SshSession.ArwjUr(Byte[] )
   at Rebex.Net.SshSession.bOtYJuZ()
   at Rebex.Net.SshSession.Negotiate()
   at Rebex.Net.Sftp.Connect(String serverName, Int32 serverPort, SshParameters parameters)






FileZilla Client

Status:    Connecting to test.test.co.uk...
Response:    fzSftp started
Command:    open "test@test.test.co.uk" 22
Command:    Trust new Hostkey: Once
Command:    Pass: ********
Status:    Connected to test.test.co.uk
Status:    Retrieving directory listing...
Command:    pwd
Response:    Current directory is: "/"
Command:    ls
Status:    Listing directory /
Status:    Calculating timezone offset of server...
Command:    mtime "test.csv"
Response:    1462075500
Status:    Timezone offsets: Server: -3600 seconds. Local: 0 seconds. Difference: 3600 seconds.
Status:    Directory listing successful
commented Jul 12, 2016 by Lukas Pokorny (85,170 points)
You are using Rebex SFTP 2.0.3854.0, which is 6 years old. Can you please try connecting with the current version? You can download the trial  from http://www.rebex.net/sftp.net/download.aspx and try connecting using its SftpWinFormClient sample.
commented Jul 13, 2016 by Ritesh (290 points)
Thanks for your help. the new component is working fine!. I have another question

I have created a folder called ABC In my local disk where I want all the files to be downloaded so for example C:\ABC. In my root folder of the FTP server I have sub folder
called xyz where all the files have been stored. so when I am running the program the files are getting downloaded in C:\ABC\XYZ but I don't want like that I want them to be downloaded in C:\ABC folder only
Is there any way we can achieve this?

Many Thanks
commented Jul 13, 2016 by Ritesh (290 points)
I think I have got that. Thanks for all your help.
commented Jul 13, 2016 by Lukas Matyska (38,400 points)
Yes, append asterisk '*' to the source path, like this ftp.Download("/XYZ/*", "C:/ABC").
...