+1 vote
by (350 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
by (73.5k points)
edited by

The error is most likely caused by a mismatch between the form of Diffie-Hellman group exchange used by the client and the server. The old Rebex client uses the legacy form that was prevalent in early days of the SSH protocol (even as late as 2010, legacy form was the only form supported by some servers), but the server you are connecting to insists on using the standard form which is prevalent now. Historically, many servers supported both forms, but it looks like some SSH servers have recently started rejecting clients using the legacy form.

Possible solutions:

  1. Set Sftp object's Settings.SshParameters.UseLegacyGroupExchange property to false (only available in Rebex SFTP 2017 R6.2 and later).

  2. Upgrade to a recent version of Rebex SFTP. To make sure it resolves the issue, try the free 30-day trial first.

by (350 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
by (73.5k 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)
by (350 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
by (148k 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.
by (350 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
by (350 points)
I think I have got that. Thanks for all your help.
by (73.5k points)
Yes, append asterisk '*' to the source path, like this ftp.Download("/XYZ/*", "C:/ABC").
by (3.9k points)
You are using Rebex SFTP Version 2012 R3 , which is 5 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.
by
I have updated to the latest Rebex SFTP  but i'm still getting same error "Key exchange failed. Requested service is not implemented." any help?
by (148k points)
Please create a log using Sftp object's LogWriter property (as described at https://www.rebex.net/kb/logging/) and either post it here or mail it to support@rebex.net for analysis. Thanks!
by
I am getting a similar error, "Negotiation failed. Requested service is not implemented."
It's actually been intermittent, it failed last week. Started working again for a few days, then failed again this morning.
I was on 2018 R1.1.  I tried updating to R3 with the same problem.  I'm including logs from 1.1 and 3

2018-10-26 10:04:13.255 Opening log file.
2018-10-26 10:04:13.257 INFO FileLogWriter(1)[13] Info: Assembly: Rebex.Common 2018 R1.1 for .NET 4.0-4.7
2018-10-26 10:04:13.272 INFO FileLogWriter(1)[13] Info: Platform: Windows 6.1.7601 32-bit; CLR: 4.0.30319.42000
2018-10-26 10:04:13.272 DEBUG FileLogWriter(1)[13] Info: Culture: en; Windows-1252
2018-10-26 10:04:13.291 INFO Sftp(1)[13] Info: Connecting to SFTP.RENOWN.ORG:22 using Sftp.
2018-10-26 10:04:13.291 INFO Sftp(1)[13] Info: Assembly: Rebex.Sftp 2018 R1.1 for .NET 4.0-4.7
2018-10-26 10:04:13.291 INFO Sftp(1)[13] Info: Platform: Windows 6.1.7601 32-bit; CLR: 4.0.30319.42000
2018-10-26 10:04:13.291 DEBUG Sftp(1)[13] Info: Culture: en; Windows-1252
2018-10-26 10:04:13.307 DEBUG ProxySocket(1)[13] Proxy: Resolving 'SFTP.RENOWN.ORG'.
2018-10-26 10:04:13.311 DEBUG ProxySocket(1)[13] Proxy: Connecting to 204.115.221.12:22 (no proxy).
2018-10-26 10:04:13.401 DEBUG Sftp(1)[13] SSH: Server is 'SSH-2.0-7.7.1.0_openssh Please call support'.
2018-10-26 10:04:13.410 INFO Sftp(1)[13] SSH: Negotiation started.
2018-10-26 10:04:13.606 DEBUG Sftp(1)[13] SSH: Group exchange (legacy form).
2018-10-26 10:04:13.654 ERROR Sftp(1)[12] SSH: Error occured while receiving SSH packet: Rebex.Net.SshException: Requested service is not implemented.
   at Rebex.Net.SshSession.edof(Byte[] adq, Int32 adr, Int32 ads)
   at Rebex.Net.SshSession.edoe(Byte[] adn, Int32 ado, Int32 adp)
   at Rebex.Net.SshSession.edod()
   at Rebex.Net.SshSession.muoc.edpb()
2018-10-26 10:04:13.656 ERROR Sftp(1)[13] SSH: Negotiation failed. Requested service is not implemented.
2018-10-26 10:04:13.657 ERROR Sftp(1)[13] Info: Rebex.Net.SshException: Requested service is not implemented. ---> Rebex.Net.SshException: Requested service is not implemented.
   at Rebex.Net.SshSession.edof(Byte[] adq, Int32 adr, Int32 ads)
   at Rebex.Net.SshSession.edoe(Byte[] adn, Int32 ado, Int32 adp)
   at Rebex.Net.SshSession.edod()
   at Rebex.Net.SshSession.muoc.edpb()
   --- End of inner exception stack trace ---
   at Rebex.Net.SshSession.edny()
   at Rebex.Net.SshSession.edoa[a,b](bckp`2 adh, Int32 adi, bckq adj, b adk, a adl, a adm)
   at Rebex.Net.SshSession.edoh(murh adv)
   at murl.pvue(SshSession awy, Byte[] awz, Byte[] axa, Byte[] axb, Byte[] axc, murb& axd, Byte[]& axe, SshPublicKey& axf)
   at Rebex.Net.SshSession.edoj(Byte[] adw)
   at Rebex.Net.SshSession.Negotiate()
   at Rebex.Net.Sftp.yynz.cqmt(cfxh ame, Boolean amf)
   at Rebex.Net.Sftp.lshv(String qi, Int32 qj, SshParameters qk, cfxh ql)






2018-10-26 10:42:15.121 Opening log file.
2018-10-26 10:42:15.125 INFO FileLogWriter(1)[15] Info: Assembly: Rebex.Common 2018 R3 for .NET 4.0-4.7
2018-10-26 10:42:15.127 INFO FileLogWriter(1)[15] Info: Platform: Windows 6.1.7601 32-bit; CLR: 4.0.30319.42000
2018-10-26 10:42:15.127 DEBUG FileLogWriter(1)[15] Info: Culture: en; Windows-1252
2018-10-26 10:42:15.144 INFO Sftp(1)[15] Info: Connecting to SFTP.RENOWN.ORG:22 using Sftp.
2018-10-26 10:42:15.144 INFO Sftp(1)[15] Info: Assembly: Rebex.Sftp 2018 R3 for .NET 4.0-4.7
2018-10-26 10:42:15.144 INFO Sftp(1)[15] Info: Platform: Windows 6.1.7601 32-bit; CLR: 4.0.30319.42000
2018-10-26 10:42:15.144 DEBUG Sftp(1)[15] Info: Culture: en; Windows-1252
2018-10-26 10:42:15.155 DEBUG Sftp(1)[15] Proxy: Resolving 'SFTP.RENOWN.ORG'.
2018-10-26 10:42:15.158 DEBUG Sftp(1)[15] Proxy: Connecting to 204.115.221.12:22 (no proxy).
2018-10-26 10:42:15.243 DEBUG Sftp(1)[15] SSH: Server is 'SSH-2.0-7.7.1.0_openssh Please call support'.
2018-10-26 10:42:15.250 INFO Sftp(1)[15] SSH: Negotiation started.
2018-10-26 10:42:15.421 DEBUG Sftp(1)[15] SSH: Group exchange (legacy form).
2018-10-26 10:42:15.464 ERROR Sftp(1)[21] SSH: Error occured while receiving SSH packet: Rebex.Net.SshException: Requested service is not implemented.
   at Rebex.Net.SshSession.fmkq(Byte[] agf, Int32 agg, Int32 agh)
   at Rebex.Net.SshSession.fmkp(Byte[] agc, Int32 agd, Int32 age)
   at Rebex.Net.SshSession.fmko()
   at Rebex.Net.SshSession.itzj.fmlm()
2018-10-26 10:42:15.466 ERROR Sftp(1)[15] SSH: Negotiation failed. Requested service is not implemented.
2018-10-26 10:42:15.468 ERROR Sftp(1)[15] Info: Rebex.Net.SshException: Requested service is not implemented. ---> Rebex.Net.SshException: Requested service is not implemented.
   at Rebex.Net.SshSession.fmkq(Byte[] agf, Int32 agg, Int32 agh)
   at Rebex.Net.SshSession.fmkp(Byte[] agc, Int32 agd, Int32 age)
   at Rebex.Net.SshSession.fmko()
   at Rebex.Net.SshSession.itzj.fmlm()
   --- End of inner exception stack trace ---
   at Rebex.Net.SshSession.fmkj()
   at Rebex.Net.SshSession.fmkl[b,c](lcyp`2 afw, Int32 afx, lcyq afy, c afz, b aga, b agb)
   at Rebex.Net.SshSession.fmks(iuco agk)
   at iucs.xoag(SshSession azr, Byte[] azs, Byte[] azt, Byte[] azu, Byte[] azv, iuci& azw, Byte[]& azx, SshPublicKey& azy)
   at Rebex.Net.SshSession.fmku(Byte[] agl)
   at Rebex.Net.SshSession.Negotiate()
   at Rebex.Net.Sftp.srhy.frfl(nnui alr, Boolean als)
   at Rebex.Net.Sftp.xhez(String po, Int32 pp, SshParameters pq, nnui pr)
by (148k points)
edited by
This error occurred after our SSH client tried to start a legacy form of Diffie-Hellman group exchange, which seems strange, because the server seems to be modern.
Are you setting Sftp object’s Settings.SshParameters.UseLegacyGroupExchange in your code?
In any case, please try setting that property to false before calling Sftp.Connect and if it still fails, please create and post an updated log.
...