0 votes
by (150 points)
edited

Maybe I am over simplifying this, but I cant seem to get an upload to work correctly. Any assistance appreciated. Thanks!

    Dim DriveLetter As String = txtDriveLetter.text
    Try
        rscp.LogWriter = New Rebex.FileLogWriter(DriveLetter & log, Rebex.LogLevel.Verbose)
        Dim key As Rebex.Net.SshPrivateKey = New Rebex.Net.SshPrivateKey(DriveLetter & keypath, "")

        rscp.Connect(server)
        rscp.Login(Uid, key)
        rscp.Timeout = 0
        rscp.PutFile(DriveLetter & localFile, "TEST_FILE.txt")
        rscp.Disconnect()
    Catch ex As Rebex.Net.ScpException
        MessageBox.Show(ex.Message)
    End Try

Error:

2012-10-03 06:34:17.204 DEBUG Scp(1) Info: Connection closed.
2012-10-03 06:34:17.454 ERROR Scp(1) Info: Rebex.Net.ScpException: The server has closed the connection.
   at wWGvS.isuQH.cLGgeAZ(Boolean )
   at Rebex.Net.Scp.cqcMbi(String , Stream , Int64 )

Log after running Trial binaries:

2012-10-11 19:58:19.590 Opening log file.
2012-10-11 19:58:19.746 INFO Scp(1)[9] Info: Connecting to SERVERNAME:22 using Scp 3.0.4660.1 (trial version).
2012-10-11 19:58:20.324 DEBUG Scp(1)[9] SSH: Server is 'SSH-2.0-OpenSSH_4.3'.
2012-10-11 19:58:20.340 INFO Scp(1)[9] SSH: Negotiation started.
2012-10-11 19:58:20.402 DEBUG Scp(1)[9] SSH: Group exchange.
2012-10-11 19:58:20.496 DEBUG Scp(1)[9] SSH: Negotiating key.
2012-10-11 19:58:20.949 DEBUG Scp(1)[9] SSH: Validating signature.
2012-10-11 19:58:21.012 INFO Scp(1)[9] SSH: Negotiation finished.
2012-10-11 19:58:21.012 INFO Scp(1)[9] Info: Server: SSH-2.0-OpenSSH_4.3
2012-10-11 19:58:21.012 INFO Scp(1)[9] Info: Fingerprint: 23:2c:16:73:d8:23:5b:e5:db:fc:86:a3:71:4d:7a:df
2012-10-11 19:58:21.012 INFO Scp(1)[9] Info: Cipher info: SSH 2.0, DiffieHellmanGroupExchangeSHA1, DSS, aes256-cbc/aes256-cbc, hmac-sha1/hmac-sha1
2012-10-11 19:58:21.215 DEBUG Scp(1)[9] SSH: Allowed authentication methods: publickey, publickey.
2012-10-11 19:58:21.215 DEBUG Scp(1)[9] SSH: Trying public key authentication for USERNAME.
2012-10-11 19:58:21.637 DEBUG Scp(1)[9] SSH: Authentication successful.
2012-10-11 19:58:24.043 INFO Scp(1)[9] Info: Executing 'scp -t "."'
2012-10-11 19:58:24.043 DEBUG Scp(1)[9] SSH: Executing command 'scp -t "."'.
2012-10-11 19:58:24.606 DEBUG Scp(1)[9] Info: Connection closed.
2012-10-11 19:58:24.637 ERROR Scp(1)[9] Info: Rebex.Net.ScpException: The server has closed the connection.
   at gbMKS.8dmtI.1viNtJZ(Boolean )
   at gbMKS.8dmtI.1viNtJZ()
   at Rebex.Net.Scp.1xTmHi(String , String , Stream , Int64 )

1 Answer

0 votes
by (144k points)

Which SSH server do you use? Another user recently reported an issue with Dropbear SSH server which manifested in a very similar way to this. Whether you use the same server or not, please try using the hotfix build from http://www.rebex.net/getfile/0ab9b641c71e437998d35d9375f0b658/RebexSftp-HotfixBuild4660-Trial-Binaries.zip and let us know whether it makes any difference. If it doesn't, please mail us a more thorough log to support@rebex.net (or edit your question to include it). Thanks!

...