Re: using ssh2 on linux shell

2009-09-25 Thread Marek Zizlavsky
Hi, I'm working on NETCONF protocol implementation, which uses SSH as transport layer. I make some testing around libssh2. I tried to use standard command execution, shell execution and my own SSH subsystem. I have lot of problems with shell, similar to yours. Finally I have used separate reading

Re: using ssh2 on linux shell

2009-09-25 Thread Alexander Lamaison
2009/9/25 bill marr : > >     You are so right :-) Glad I helped. I hope this demonstrates the need to *always* post code. Alex ___ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

RE: using ssh2 on linux shell

2009-09-25 Thread bill marr
Alex, You are so right :-) Many Thanks. > Date: Fri, 25 Sep 2009 08:29:13 +0100 > Subject: Re: using ssh2 on linux shell > From: sw...@lammy.co.uk > To: libssh2-devel@cool.haxx.se > > 2009/9/25 : > > > > QString testc

Re: using ssh2 on linux shell

2009-09-25 Thread Daniel Stenberg
On Fri, 25 Sep 2009, bill_m...@hotmail.com wrote: Please trim your quotes. Remove all the quotes that don't add anything to the contents of your mail. rc = libssh2_channel_read( channel, buffer, sizeof(buffer)); if( rc > 0 ) { recvData = tr(buffer); Ok, I don't know what tr() do

Re: using ssh2 on linux shell

2009-09-25 Thread Alexander Lamaison
2009/9/25 : > >   QString testcmd =ui->lineEdit->text()+"\r\n"; > > libssh2_channel_write(channel,testcmd.toStdString().c_str(),sizeof(testcmd.toStdString().c_str())); I don't know if this is the source of your problems but I very much doubt you should be using sizeof here. sizeof is a *compile*

Re: using ssh2 on linux shell

2009-09-24 Thread bill_marr
Sleep(1000); int rc = libssh2_channel_read( channel, buffer, sizeof(buffer)); if( rc > 0 ) { recvData = tr(buffer); ui->textEdit->append(recvData); recvData.clear(); memset(buffer, '\0', 4096); } ui->lineEdit->clear(); } -

Re: using ssh2 on linux shell

2009-09-22 Thread Peter Stuge
bill_m...@hotmail.com wrote: > But command "ls -l", just response "ls -". (all of them I had > added line feed after command string) > The same server, the same shell commands, putty works well. So use PuTTY? Seriously, I am confident that all your shell problems are because you are trying to c

Re: using ssh2 on linux shell

2009-09-22 Thread Alexander Lamaison
2009/9/22 : >  On Sep 8, I got your suggestion about sending a line feed after command > string to shell, the shell works well but with tiny matter. >  This time my question exactly is that in some cases shell not response the > right string. >  For example, >  command "who", response what I want.

Re: using ssh2 on linux shell

2009-09-22 Thread bill_marr
But command "ls -l", just response "ls -". (all of them I had added line feed after command string) The same server, the same shell commands, putty works well. Could you take a look at my problem? Thanks and Best Regards. Bill. ------------

Re: using ssh2 on linux shell

2009-09-21 Thread Peter Stuge
Hi again Bill, bill_m...@hotmail.com wrote: > For example, "ls -l" response "ls -", another "ls -l" response "ls -", > but if followed "ls", response the format of "ls -l". The same to "cd .." > response "cd .". It seems simple but not works. Keep in mind that shells are created for humans. W

Re: using ssh2 on linux shell

2009-09-21 Thread bill_marr
e "ls -", but if followed "ls", response the format of "ls -l". The same to "cd .." response "cd .". It seems simple but not works. If I using API "libssh2_channel_exec()" and read response, It works. -------------

Re: using ssh2 on linux shell

2009-09-21 Thread Peter Stuge
Hi Bill, bill_m...@hotmail.com wrote: > I studied the example of libssh2.c, which using a shell. > > I can exe shell like "who", "ls" and so on , but not "cd .." or > "ls -l", but they can exe on command mode, I do not why? Help? > pls. How do you think we can help you? How would we know