Topic "How to select the SSH-1 protocol for SFtp via .Net assembly"

Author Message
jens123
[View user's profile]

Joined: 2012-11-15
Posts: 2
Location: DE
Hello,

I need to upload some files to a server that only understands Sftp SSH-1.
Before asking the question, an update to SSH-2 is not possible.Crying or Very sad

I can connect to the server successfully with the desktop tool of WinSCP if I
choose the preferred SSH version 1, but how I do it via .Net.Question

When running the code below I get the exception "Incoming packet was garbled on decryption"

Thanks in advance.

Source code:

SessionOptions sessionOptions = new SessionOptions
{
Protocol = Protocol.Sftp,
HostName = "192.168.1.230",
PortNumber = 22,
UserName = "root",
Password = "xxxxxxxxxxx",
SshHostKeyFingerprint = null,
};

using (WinSCP.Session session = new WinSCP.Session())
{
// Connect
session.DefaultConfiguration = false;
session.Open(sessionOptions);

.......
jens123
[View user's profile]

Joined: 2012-11-15
Posts: 2
Location: DE
After I have experimented a lot, I have it figured out:

sessionOptions.AddRawSettings("Compression", "0");
sessionOptions.AddRawSettings("SshProt", "1");

Nevertheless thanks.Mr. Green
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24538
Location: Prague, Czechia
Thanks for your post.
I have added this to the documentation:
http://winscp.net/eng/docs/rawsettings
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License