Connect to ssh using password and username

0 votes
asked Feb 8 by odufour (130 points)
edited Feb 8 by odufour

I have a Linux server (ftp.plurimedia.fr) that I want to connect to using a username and a password
The following code gives an error 'Key exchange failed. Requested service is not implemented.'

   var session = new SshSession();
   session.Connect("ftp.plurimedia.fr", 22);

I also tried :

   var ssh = new Rebex.Net.Ssh();
   // connect to a server
   ssh.Connect("ftp.plurimedia.fr");

but somehow Rebex.Net.Ssh() is not recognized. Which namespace is missing?

I am using the last (paid)Rebex version, in .net Framework 4.5

1 Answer

+1 vote
answered Feb 8 by Lukas Matyska (42,630 points)

The "Requested service is not implemented" error occurs when the client receives a SSH_MSG_UNIMPLEMENTED response from the server (see RFC4253). Without further investigation, we are unable to tell whether this is a fault in Rebex SSH or not.

Please create Verbose communication log and send it to support@rebex.net for analysis. The log can be done like this:

var session = new SshSession();
session.LogWriter = new Rebex.FileLogWriter(@"c:\data\ssh.log", Rebex.LogLevel.Verbose);
session.Connect("ftp.plurimedia.fr", 22);

The Rebex.Net.Ssh class is part of Rebex Terminal Emulation product. If you have bought Rebex SFTP product, the class is not included.

commented Feb 9 by odufour (130 points)
edited Feb 9 by odufour
Thanks but which namespaces should I use ?
 
      var session = new Rebex.Net.SshSession();
       session.LogWriter = new Rebex.FileLogWriter(@"c:\data\ssh.log", Rebex.LogLevel.Verbose);
       session.Connect("ftp.plurimedia.fr", 22);


I get the following error :
The type 'SshSession' exists in both 'Rebex.Net.Ssh, Version=2.0.4086.0, Culture=neutral, PublicKeyToken=1c4638788972655d' and 'Rebex.Networking, Version=3.0.6249.0, Culture=neutral, PublicKeyToken=1c4638788972655d'     

 I dont understand because I use

 var session = new Rebex.Net.SshSession();

Ole Dufour
commented Feb 9 by Lukas Pokorny (92,230 points)
It looks like you are trying to use two different sets of Rebex assemblies in a single project. One is a seven-year-old legacy version ( https://www.rebex.net/ssh-pack/history.aspx#4086 ), the other one is one-year-only 2017 R1 version ( https://www.rebex.net/ssh-pack/history.aspx#2017R1 ).

Please discard the old version and try again (remove Rebex.Net.* assemblies, keep the rest - check out http://blog.rebex.net/version-2012-r1/ for details).
commented Feb 9 by odufour (130 points)
Good stuff, thanks. Got it up and running. Would like to give you kudos but that doesn't seem to work for comments!
...