Xu, Qiang (FXSGSC) wrote:
> > If the server does indeed follow the protocol and this 
> > confuses libssh2, then yes it is a libssh2 bug. But if it 
> > isn't following the protocol it is a server bug.
> 
> What does the protocol say about having echo command in start-up
> shell script?

It is not allowed.

When libssh2 wants to do sftp, it tells the sshd so, requesting the
sftp subsystem.

The sshd then chooses how to handle this request.

Recent OpenSSH can be configured two ways for SFTP;

One way (and the default) is that it executes the standalone program
sftp-server, with the help of the user's shell. At this point it is
important that there is no shell output, because the response to the
subsystem request must follow protocol, and can not contain arbitrary
text.

The other way, it was introduced in 5.x IIRC, is that sshd hands over
control to an sftp-server that is internal in sshd. This means that
the shell is never executed. It also allows chrooting users. There is
more information in the OpenSSH documentation.


To solve the problem you can also ensure that your .cshrc only
outputs text when it is in fact started in interactive mode. I hope
that the csh documentation will have information on how to do that,
if not you'll have to search the internet.


//Peter
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

Reply via email to