Server unexpectedly closed network connection. ( C# , win7 to VMS, with dh-group1-sha1)

Advertisement

mafis
Joined:
Posts:
3
Location:
Hungary

Server unexpectedly closed network connection. ( C# , win7 to VMS, with dh-group1-sha1)

Hi Martin, hi Winscp-Team,


in my report "***" mean "I remmoved a part of string".
I use "win7", "Open-VMS 8.3", "winscp v5.9", "VisualStudio 2015 Express"

So when I run the follow command in cmd.exe:

"C:\Program Files\WinSCP\winscp.com" /command "open sftp://cba***:haf***@5.175.***.*** -hostkey=""*"" -rawsettings KEX=""dh-group1-sha1,dh-group14-sha1,dh-gex-sha1,rsa,WARN"" " "pwd" "exit" /log="C:\Users\***\Desktop\winscp_bug\batch.log" /loglevel=2

then it is workd. OK :)
("dh-group1-sha1" must be used for VMS )
I attached thw log from batch-run too.(batch.log)

But when I run my "C#_code.cs" (it is attached)
I get this output with error :

dumpCommand: pwd
output :
ErrorOutput:
IsSuccess : False
ExitCode : 0
WinSCP.SessionRemoteException: Server unexpectedly closed network connection.
Authentication log (see session log for details):
Using username "cba***".
Authentication failed.
Server unexpectedly closed network connection.
Authentication log (see session log for details):
Using username "cba***".
Authentication failed.

The "session.DebugLogPath" and "session.SessionLogPath" are attached too. (c#_code.deblog, c#_code.log)

IP, loginname, password, winscp version are same.
When I mixd run the "batch" and "c#_code" i have the same error for "c#_code" and the batch is always error-free.

I read the forum and the documentation but i din'nt find explanation or i am not enought adept.
I hope you can help for me.
Thanks in advance!

Csaba


ps.: sorry for my poor english
  • winscp_bug.rar (14.11 KB, Private file)
Description: all attached file is here and compressd

Reply with quote E-mail

Advertisement

mafis
Joined:
Posts:
3
Location:
Hungary

Server unexpectedly closed network connection. ( C# , win7 to VMS, with dh-group1-sha1)

Thanks for the links!

I tried to write out the session.HomePath after session.Open:
log.wrln("home-path: >" + session.HomePath+"<");
home-path: >/disk$data_4/user/cba***<

it worked so the winscp can use the VMS.

I tried the command line too :
"C:\Program Files\WinSCP\winscp.com" /command "open sftp://cba***:haf***@5.175.***.*** -hostkey=""*"" -rawsettings KEX=""dh-group1-sha1,dh-group14-sha1,dh-gex-sha1,rsa,WARN"" " "pwd" "exit"
and
"C:\Program Files\WinSCP\winscp.com" /command "open sftp://cba***:haf***@5.175.***.*** -hostkey=""*"" -rawsettings KEX=""dh-group1-sha1,dh-group14-sha1,dh-gex-sha1,rsa,WARN"" " "ls" "exit"
It worked too. I can see the ls's output.

I tried other command to run in C# :
dumpCommand = "ls";
but the error is same: "Server unexpectedly closed network connection."

Can you help me with other links?
Thanks in advance!
Csaba

Reply with quote E-mail

mafis
Joined:
Posts:
3
Location:
Hungary

Server unexpectedly closed network connection. ( C# , win7 to VMS, with dh-group1-sha1)

On VMS :
> show symbol pwd
PWD == "SHOW DEFAULT"

"symbol" is similar to "alias" on linux.

Csaba

Reply with quote E-mail

martin
Site Admin
martin avatar

Re: Server unexpectedly closed network connection. ( C# , win7 to VMS, with dh-group1-sha1)

I mean you can hardly make the ExecuteCommand work on the VMS in general. Why do you want to call the ls command? Use the ListDirectory.

Reply with quote

Advertisement

You can post new topics in this forum