.Net Sftp stopped working

+1 vote
asked Nov 20 by vsikka (170 points)

Hi

I downloaded a free trial of your .Net library. Working with .Net 4.7. Tried connecting to a server yesterday. All was fine - I could retrieve items.
Today I am getting exception: Rebex.Net.SftpException: 'The connection was closed by the server. Make sure you are connecting to an SSH or SFTP server.'

I have checked with WinSCP. The connection to the server is fine using Sftp protocol. Here are details from WinSCP. I could see these details yesterday using your api.

**File transfer protocol = SFTP-6
Cryptographic protocol = SSH-2
SSH implementation = VShell4421912 VShell
Encryption algorithm = aes

Compression = No

Server host key fingerprint

ssh-rsa 2048 ef:d7:92:d4:e3:3a:af:7a:f1:ae:86:61:50:22:08:3d

Can change permissions = No
Can change owner/group = Yes
Can execute arbitrary command = No
Can create symbolic/hard link = Yes/Yes
Can lookup user groups = No
Can duplicate remote files = Yes
Can check available space = Yes
Can calculate file checksum = Yes

Native text (ASCII) mode transfers = Yes

Additional information
The server supports these SFTP extensions:
newline@vandyke.com=0x000000020D0A
newline="\r\n"
default-fs-attribs@vandyke.com=0x00000001000000095C2F3A2A3F223C3E7C0000001700000004434F4D3100000004434F4D3200000004434F4D3300000004434F4D3400000004434F4D3500000004434F4D3600000004434F4D3700000004434F4D3800000004434F4D39000000044C505431000000044C505432000000044C505433000000044C505434000000044C505435000000044C505436000000044C505437000000044C505438000000044C5054390000000350524E00000003434F4E00000003415558000000034E554C00000006434C4F434B24
supported=0x800003F900000017000009FF001F01FF000200000000000F73706163652D617661696C61626C650000001373746174766673406F70656E7373682E636F6D0000002766732D6D756C7469706C652D726F6F74732D737570706F727465644076616E64796B652E636F6D00000013736674702D73754076616E64796B652E636F6D00000022726561642D6469726563746F72792D6368616E6765734076616E64796B652E636F6D00000009746578742D7365656B0000000976656E646F722D69640000000E76657273696F6E2D73656C6563740000000E686F6D652D6469726563746F727900000009636F70792D66696C650000000F6765742D74656D702D666F6C646572000000106D616B652D74656D702D666F6C64657200000011636865636B2D66696C652D68616E646C650000000F636865636B2D66696C652D6E616D65000000226765742D766F6C756D652D696E666F726D6174696F6E4076616E64796B652E636F6D0000000A636865636B2D66696C65
supported2=0x800003F900000017000009FF001F01FF0002000000FF000000000000000000100000000F73706163652D617661696C61626C650000001373746174766673406F70656E7373682E636F6D0000002766732D6D756C7469706C652D726F6F74732D737570706F727465644076616E64796B652E636F6D00000013736674702D73754076616E64796B652E636F6D00000022726561642D6469726563746F72792D6368616E6765734076616E64796B652E636F6D00000009746578742D7365656B0000000976656E646F722D69640000000E76657273696F6E2D73656C6563740000000E686F6D652D6469726563746F727900000009636F70792D66696C650000000F6765742D74656D702D666F6C646572000000106D616B652D74656D702D666F6C64657200000011636865636B2D66696C652D68616E646C650000000F636865636B2D66696C652D6E616D65000000226765742D766F6C756D652D696E666F726D6174696F6E4076616E64796B652E636F6D0000000A636865636B2D66696C65
vendor-id=0x0000001656616E44796B6520536F6674776172652C20496E632E00000006565368656C6C00000016342E342E322028783634206275696C642031393132290004000400000778
versions="3,4,5,6,draft-ietf-secsh-filexfer-11@vandyke.com,partial-v6@vandyke.com"

statvfs@openssh.com="2"

Total bytes on device = 249 GB (268,432,306,176 B)
Free bytes on device = 54.7 GB (58,772,754,432 B)
Total bytes for user = 249 GB (268,432,306,176 B)
Free bytes for user = 54.7 GB (58,768,560,128 B)
Bytes per allocation unit = 4.00 KB (4,096 B)**

What could be the issue?

regards
Vinay

Applies to: Rebex SFTP
commented Nov 20 by Lukas Pokorny (116,670 points)
Are you connecting to a proper port? SFTP runs on 22 by default.
If you are, please create a communication log using Sftp object's LogWriter property (as described at https://www.rebex.net/kb/logging/) and either post it here or mail it to us for analysis. That should make it possible to tell what is going on.

1 Answer

0 votes
answered Nov 22 by vsikka (170 points)

It seems to be working now. I was not calling Disconnect. After calling that I am not having any issue.

Does that make sense?

regards
Vinay

commented 6 days ago by Lukas Pokorny (116,670 points)
It's hard to tell based on the limited information we have. A communication log would hopefully make it possible to determine what is going on.
...