tags:

views:

773

answers:

3

I'm using Tamir.SharpSsh to upload a file to a ssh server with the code below but I'm getting System.IO.IOException: Pipe closed. Any clue why?

    SshTransferProtocolBase scp = new Scp(SSH_HOST, SSH_USER);
    scp.Password = SSH_PASSWORD;
    scp.Connect();
    foreach (string file in files)
    {
        string remotePath = "incoming/" + new FileInfo(file).Name;
        scp.Put(file, remotePath);
    }
    scp.Close();

Regards /Niels

A: 

Sounds like it might have to do with permissions on the remote server.

CSharpAtl
A: 

For future references: Apparently the server only accepted Sftp connections. So I changed to:

SshTransferProtocolBase scp = new Sftp(SSH_HOST, SSH_USER);
Niels Bosma
+2  A: 

I had exaclty the same problem ("Pipe Closed") when trying to transfer files.
Changing to

    Sftp scp = new Sftp(SSH_HOST, SSH_USER);

solved the problem.
Thanks
Stefano

Stefano