Archived Forum Post

Index of archived forum posts

Question:

scp.UploadFile CHANNEL_OPEN_FAILURE

Jan 19 '16 at 13:37

I have a program which is attempting to issue 8 calls to UploadFile() in succession. The first three are successful, and the fourth always fails with CHANNEL_OPEN_FAILURE, reason code 1, SSH_OPEN_ADMINISTRATIVELY_PROHIBITED. It's not the actual file itself, because I have switched around the order in which I'm uploading, and the first three, whatever they are, are successful, and the 4th attempt fails again. Is there some sort of limitation, or configuration option, that is controlling this? Why only three?

UPDATE - I have modified MaxSessions in sshd_config from 4 to 5, and now I can upload one additional file, so this is definitely my gating factor. I created the scp instance and then called scp.UseSsh(). I thought this would all share the same ssh session? Am I misunderstanding how this works? It is apparently creating a new session each time it calls the scp upload.

ANOTHER UPDATE - It has become apparent from my experimentation that the scp.UploadFile() is opening a channel and then not closing it when the upload is complete. The only way to free the channels is to close the ssh session. I tried overtly opening a channel before the UploadFile() call, but that is then not the channel that is used, so I actually made my situation worse. There is no scp method to direct an upload to a particular channel. Any comments from the Chilkat development team?


Answer

This wouldn't be a limitation in Chilkat. The next step is to research the SSH server to see what limitations / configuration options exist. A good first step is to Google the error message ("SSH_OPEN_ADMINISTRATIVELY_PROHIBITED") to see if others have experienced the same problem, and if so, what the resolution may have been.