zhang at csee.wvu.edu
2003-Jan-06 03:12 UTC
Is sftp-server's stdout redirected to client ?
Hello everyone, I added some code to sftp, which would be useful for me. I add a command "run", which can run any command on the remote shell, in the mean time I want the server send the standard output back. for example, when I : sftp> run ls I want to see the result locally. I thought the stdout of sftp-server has been redirected to the client. But I get "message too long" error. When I check the received buffer, it do have part of the server's standard output, but it is messed up. How do I fix it? Thanks, Hanzhou
this won't work. you need to extend the sftp protocol. sftp-server prints the messages to stdout and expencts the requests from the client on stdin. i don't think this change makes sense. On Sun, Jan 05, 2003 at 10:12:45PM -0500, zhang at csee.wvu.edu wrote:> Hello everyone, > > I added some code to sftp, which would be useful for me. I add a > command "run", which can run any command on the remote shell, in the mean > time I want the server send the standard output back. for example, when I : > > sftp> run ls > > I want to see the result locally. > > I thought the stdout of sftp-server has been redirected to the client. But > I get "message too long" error. When I check the received buffer, it do > have part of the server's standard output, but it is messed up. > > How do I fix it? Thanks, > > Hanzhou > > > _______________________________________________ > openssh-unix-dev at mindrot.org mailing list > http://www.mindrot.org/mailman/listinfo/openssh-unix-dev
Avraham Fraenkel - Commatch
2003-Jan-07 08:10 UTC
Is sftp-server's stdout redirected to client ?
Hello, Another suggestion - redirect the command output to stderr, this will go to the sftp-client stderr and (in openssh client) will showed on the screen. (The syntax depend on the shell on the server). In the sftp protocol there is no way to send data to the client in any other way. -- Avraham --------------------------------------- Markus Friedl Wrote: this won't work. you need to extend the sftp protocol. sftp-server prints the messages to stdout and expencts the requests from the client on stdin. i don't think this change makes sense. On Sun, Jan 05, 2003 at 10:12:45PM -0500, zhang at csee.wvu.edu wrote:> Hello everyone, > > I added some code to sftp, which would be useful for me. I add a > command "run", which can run any command on the remote shell, in the mean > time I want the server send the standard output back. for example, when I:> > sftp> run ls > > I want to see the result locally. > > I thought the stdout of sftp-server has been redirected to the client. But > I get "message too long" error. When I check the received buffer, it do > have part of the server's standard output, but it is messed up. > > How do I fix it? Thanks, > > Hanzhou > > > _______________________________________________ > openssh-unix-dev at mindrot.org mailing list > http://www.mindrot.org/mailman/listinfo/openssh-unix-dev_______________________________________________ openssh-unix-dev at mindrot.org mailing list http://www.mindrot.org/mailman/listinfo/openssh-unix-dev