Enhanced SharpSSH – In .NET 3.5 & Support for SFTP Delete

On my current project we had a requirement to drop a file onto an SFTP server.  SharpSSH seems to the only free and open source option around for .NET

Some of the pain points of SharpSSH

  • SharpSSH was written in older version of .NET and relies on algorithms in Org.Mentalis.Security.Cryptography for encryption and hashing which is now natively supported by System.Security.Cryptograph so using SharpSSH as is does not seem right
  • Sftp implementation does not support deleting a file (although it is very simple to add that!)
  • Not complied with a Strong name key

Making above changes looked easy enough, so here is the download of SharpSSH – SFTP component for .NET which:

  • Uses algorithms in System.Security.Cryptograph instead of Org.Mentalis.Security.Cryptography
  • Compiled using  .NET 3.5 with strong name  and Project converted to Visual Studio 2008
  • Supports Deleting a file, directory and renaming over SFTP

Download Enhanced SharpSSH Here


26 thoughts on “Enhanced SharpSSH – In .NET 3.5 & Support for SFTP Delete

  1. Open-sourceness of SharpSSH is it’s only benefit. This is an incomplete port of some Java libraries. As such, it’s not supported, doesn’t contain many of features that you will need one day in SFTP and so on. It doesn’t even work right with many servers.

    • Agree it’s not the “Rolls-Royce” solution but it was perfect more my basic needs, Just sharing the source code changes that I did in the spirit of Open Source

  2. I have been using the SharpSSH without too many issues. One issue the original has is it does not work on 64 bit because I believe org.mentalis.security does not work with 64 bit. Has anyone confirmed the enhanced version works on 64 bit ?

  3. I don’t think SFTP in x64 works with this library either. At least I get the same exact error as with the original Tamir SharSSH project. “BAD DATA” There appears to be something broken with connect()

  4. Hi,
    I just started using SharpSSH, I need to connect the sftp server and download a file. I get the same error in SharpSSH and in your new version.

    My problem is in this method (in ChanelSftp):
    private String remoteAbsolutePath(String path)
    if(path.charAt(0)==’/’) return path;
    if(cwd.endsWith(“/”)) return cwd+path;
    return cwd+”/”+path;

    the problem is that cwd is null, this variable should contain the result of a pwd, apparently in the start() method this variable should be populated. I am missing something?


  5. Thanks very much for making your updates and making these changes. I needed a library that was strongly typed so I could register in the GAC and call from a C# Script Task within SSIS. I simply needed to be able to get a listing of files, download one of them, then delete it from the server. I was able to get this up and running very quickly with your help. Thanks again!

  6. Thanks for the project, this was exactly what we needed to implement an SFTP feature in a utility.

    I do have a question. It seems that there is a built-in Diffie-Hellman key generation in .NET 4.0. Is the Mentalis Diffie-Hellman library still required for this SharpSSH project? Could the Enhanced SharpSSH project be changed to use the .NET library? I’m not a cryptography expert, so please let me know if you have any insight.

    Thank you.

  7. Hi, thanks for the quick reply. My company had me looking into the encryption library used, and I appreciate the information.

  8. Hi,
    why is there an “String Name Key File” in /SolutionItems?
    Didn’t see this in the oriignal project, so whats this for?

    Best Regards,

  9. Hi, I am quite new to .net. Can you guys please tell me how you got this working. Did you create an executable or dll from this new source? I am trying to figure out how I can use this new source.

  10. Download link not working. Shows file not found error. It will be very helpful to me if getting this advanced version. Can you please help for the download.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s