SFTP Connection

0 votes
asked Nov 2, 2012 by Bharad (320 points)
edited Nov 7, 2012

Please let me know if I need to use any special method or class if I should connect to Port 22 so that I transport using SFTP connection.

Applies to: Rebex SFTP

1 Answer

0 votes
answered Nov 2, 2012 by Jan Sotola (16,920 points)
edited Nov 6, 2012

Port 22 is a default port for SFTP protocol. Using the Rebex SFTP component, you can simply connect the following way:

using Rebex.Net;
// ...

// create client object
Sftp client = new Sftp();

// connect to the server
client.Connect("servername.com");
// for connecting to non-default port, use the following alternative
// client.Connect("servername.com", 1234);

// authenticate
client.Login("username", "password");

// browse directories, transfer files, etc...
// ...

// disconnect
client.Disconnect();

For more information about using the component, see the SFTP tutorial page.

commented Nov 2, 2012 by Bharad (320 points)
edited Nov 2, 2012

Where is this class Sftp ? I don't find this in Rebex.Net.

commented Nov 2, 2012 by Bharad (320 points)
edited Nov 2, 2012

I think I need to use these dlls : Rebex.Sftp.dll, Rebex.Common.dll and Rebex.Networking.dll I will use it and check

commented Nov 2, 2012 by Jan Sotola (16,920 points)
edited Nov 2, 2012

Yes, the mentioned 3 DLLs are exactly what you need. They are content of the Rebex SFTP component.

Once you reference these 3 DLLs in your project, you'll be able to use the Rebex.Net.Sftp class.

commented Nov 2, 2012 by Bharad (320 points)
edited Nov 2, 2012

hey i dont find Rebex.Common.dll and Rebex.Networking.dll in the exes which rebex gave us. These are the EXEs I looked into :

RebexSftp-Full-2.0.4086.0-DotNet2.0 RebexFtp-Full-3.0.4086.0-DotNet2.0 RebexFtpSsl-Full-3.0.4086.0-DotNet2.0

Am I missing Something ?

But I find Rebex.Sftp.dll in RebextSFTP exe and I referenced it in my project and am now able to use all the three methods which you have mentioned . Do I still need Rebex.Networking and Rebex.common ?

commented Nov 2, 2012 by Lukas Pokorny (100,670 points)
edited Nov 2, 2012

Thre three DLLs you both mentioned were introduced in Rebex SFTP 2012 R1 (released in March 2012). Rebex SFTP you have is an older version 2.0.4086 (released in March 2011). For that version, use Rebex.Security.dll, Rebex.Net.ProxySocket.dll, Rebex.Net.Ssh.dll and Rebex.Net.Sftp.dll and the same code Jan posted here.

Of course, upgrading to Rebex SFTP 2012 R3 is recommended - check out the blogpost to see what's new: http://blog.rebex.net/news/archive/2012/11/01/version-2012-r3.aspx

commented Nov 6, 2012 by Bharad (320 points)
edited Nov 6, 2012

Cool. Is an upgrade free of cost ?

commented Nov 7, 2012 by Frantisek Bosek (1,420 points)
moved Sep 24, 2015 by Tomas Knopp

Hi Bharad,

The upgrade to Rebex SFTP 2012 R3 is free of cost, provided you have got a valid Rebex Support Contract for this year.


In case you have not renewed your Support Contract yet, you can do that yearly for 1/2 of the original price of component.


If you wish to renew it now, please write me to: support@rebex.net and I will help you with the process.


František Bošek

...