C# .NET 的 SFTP 库
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/530330/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
SFTP Libraries for .NET
提问by
Can anyone recommend a good SFTP library to use? Right now I'm looking at products such as SecureBlackbox, IPWorks SSH, WodSFTP, and Rebex SFTP. However, I have never used any SFTP library before so I'm not sure what I'm looking for.
谁能推荐一个好的 SFTP 库来使用?现在我正在研究 SecureBlackbox、IPWorks SSH、WodSFTP 和 Rebex SFTP 等产品。但是,我之前从未使用过任何 SFTP 库,所以我不确定我在寻找什么。
If anyone has used these before, is there any reason why I should go with product "X" over "Y"?
如果有人以前使用过这些,有什么理由我应该选择产品“X”而不是“Y”?
回答by TcKs
回答by GEOCHET
Check this out: http://www.tamirgal.com/home/dev.aspx?Item=sharpSsh
看看这个:http: //www.tamirgal.com/home/dev.aspx?Item=sharpSsh
SharpSSH is a pure .NET implementation of the SSH2 client protocol suite. It provides an API for communication with SSH servers and can be integrated into any .NET application.
The library is a C# port of the JSch project from JCraft Inc. and is released under BSD style license.
SharpSSH allows you to read/write data and transfer files over SSH channels using an API similar to JSch's API. In addition, it provides some additional wrapper classes which offer even simpler abstraction for SSH communication.
SharpSSH project page at source forge: http://sourceforge.net/projects/sharpssh
SharpSSH 是 SSH2 客户端协议套件的纯 .NET 实现。它提供了一个用于与 SSH 服务器通信的 API,并且可以集成到任何 .NET 应用程序中。
该库是来自 JCraft Inc. 的 JSch 项目的 C# 端口,并在 BSD 样式许可下发布。
SharpSSH 允许您使用类似于 JSch 的 API 的 API 通过 SSH 通道读取/写入数据和传输文件。此外,它还提供了一些额外的包装类,这些包装类为 SSH 通信提供了更简单的抽象。
源伪造的 SharpSSH 项目页面:http: //sourceforge.net/projects/sharpssh
回答by Bruce Blackshaw
For comprehensive SFTP support in .NET try edtFTPnet/PRO. It's been around a long time with support for many different SFTP servers.
要在 .NET 中获得全面的 SFTP 支持,请尝试edtFTPnet/PRO。支持许多不同的 SFTP 服务器已经有很长时间了。
We also sell an SFTP server for Windows, CompleteFTP, which is an inexpensive way to get support for SFTP on your Windows machine. Also has FTP and FTPS.
我们还销售适用于 Windows 的 SFTP 服务器CompleteFTP,这是一种在 Windows 计算机上获得 SFTP 支持的廉价方式。还有FTP和FTPS。
回答by Jim
We use WinSCP. Its free. Its not a lib, but has a well documented and full featured command line interface that you can use with Process.Start.
我们使用 WinSCP。免费。它不是一个库,但有一个文档齐全且功能齐全的命令行界面,您可以将其与 Process.Start 一起使用。
Update:with v.5.0, WinSCP has a .NET wrapper libraryto the scripting layer of WinSCP.
回答by Briggs
I've used IP*Works SSH and it is great. Easy to setup and use. Plus, their support is top-notch when you run into questions or problems.
我使用过 IP*Works SSH,它很棒。易于安装和使用。此外,当您遇到疑问或问题时,他们的支持是一流的。
回答by Rocklan
I've been using Chilkat's native SFTP library ( http://www.chilkatsoft.com/ssh-sftp-component.asp) for a couple of months now and it's working great. Been using it in a nightly job to download large files and do private key authentication. Only problem that I had was getting the 64bit version to work on windows server 2008, I needed to install vcredist_x64.exe ( http://www.microsoft.com/download/en/details.aspx?id=14632) on my server.
我已经使用 Chilkat 的本机 SFTP 库 ( http://www.chilkatsoft.com/ssh-sftp-component.asp) 几个月了,而且效果很好。在夜间工作中使用它来下载大文件并进行私钥身份验证。我唯一遇到的问题是让 64 位版本在 Windows Server 2008 上运行,我需要在我的服务器上安装 vcredist_x64.exe ( http://www.microsoft.com/download/en/details.aspx?id=14632) .
回答by Ronnie Overby
Bitvise has a great product called Tunnelier which can bridge FTP to SFTP. You could then use the standard FtpWebRequest in .NET.
Bitvise 有一个很棒的产品叫做 Tunnelier,它可以将 FTP 桥接到 SFTP。然后您可以在 .NET 中使用标准的 FtpWebRequest。
http://www.bitvise.com/ftp-bridge
http://www.bitvise.com/ftp-bridge
I am currently testing this for my own purposes and will update with my findings.
我目前正在出于自己的目的对此进行测试,并将更新我的发现。
update
更新
This idea is not ideal for unattended automation, unless you want to jump through hoops keeping the client connected as a service or something, which I accomplished by using NSSM.
这个想法对于无人值守自动化并不理想,除非你想跳过箍保持客户端作为服务或其他东西连接,这是我通过使用NSSM完成的。
I've tried CLI automation with various clients including bitvise and winscp.com. I've also tried these .net class libraries: Winscp, SSH.NET, SharpSSH, and the commercial SecureBlackBox SFTP client.
我已经尝试过各种客户端的 CLI 自动化,包括 bitvise 和 winscp.com。我还尝试过这些 .net 类库:Winscp、SSH.NET、SharpSSH 和商业 SecureBlackBox SFTP 客户端。
SecureBlackBox worked well, but it's very heavy-weight, can be quite expensive depending on the licensing, and I didn't agree so much with it's API.
SecureBlackBox 运行良好,但它非常重量级,根据许可可能相当昂贵,而且我不太同意它的 API。
Hands down, the best free sftp client for .NET development is winscp. I've written a few classes and extension methods to make working with it easier: Winscp.Extensions
毫无疑问,用于 .NET 开发的最佳免费 sftp 客户端是winscp。我已经编写了一些类和扩展方法来使其更容易使用:Winscp.Extensions
回答by Asbj?rn Ulsberg
I've searched around and found that this fork of SharpSSHand SSH.NETare the most up to date and best maintained libraries for SFTP(not to be confused with FTPS) communication in .NET. SSH.NET is a clean .NET 4.0 implementation of the SFTP protocol, and I've used it in a couple of solutions with flying colors and great success.
我环顾四周,发现 SharpSSH 的这个分支和SSH.NET是用于.NET 中SFTP(不要与FTPS混淆)通信的最新和维护最好的库。SSH.NET 是 SFTP 协议的一个干净的 .NET 4.0 实现,我已经在几个解决方案中使用了它,并且取得了巨大的成功。
The original SharpSshseems to be dead and most other solutions either require installation of Windows executables or a bucketload of cash (or worse; both).
原本的 夏普似乎已经死了,大多数其他解决方案要么需要安装 Windows 可执行文件,要么需要大量现金(或更糟;两者兼而有之)。