ForeverNoobie
ForeverNoobie

Reputation: 531

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.

Upvotes: 1

Views: 907

Answers (1)

Nickolay Olshevsky
Nickolay Olshevsky

Reputation: 14160

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.

Upvotes: 5

Related Questions