简体   繁体   中英

In c# how do I use FTP over SSH2, preferably without third party code

I'm writing a C# application and whenever I try any FTP action with FtpWebRequest or WebClient I always get "System.Net.WebException: The underlying connection was closed: The server committed a protocol violation." Connecting with a FTP client application (tunnelier) works perfectly well though. In the connection logs Tunnelier mentions 'Starting new SSH2 session' and 'Connecting to SSH2 sever' etc. Also I read mention of SSH causing problems in some ancient threads I found on google so I assume that's the problem I'm having.

I really rather not use third party stuff but If I must I suppose I will.

You are mixing together FTP(FTPS) and SFTP. They are completely different set of protocols. SFTP is not ordinary FTP over SSH, it is anther protocol and you need a side library to work with it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM