Re: [paramiko] unknown cipher
james bardin wrote: On Wed, Feb 3, 2010 at 5:30 AM, Marcin Krol mrk...@gmail.com wrote: Hello everyone, I'm getting 'unknown cipher': Are you using the latest version of paramiko (1.7.6)? No. Silly me. I have upgraded to 1.7.6 and it works. Thanks, James! Performance-wise: time cssh.py -y /tmp/meddir -i goodlin -p p -q ; sleep 5; time cssh4.py -y /tmp/meddir -i goodlin -p p -q real0m43.995s user0m20.062s sys 0m21.497s real0m39.163s user0m10.684s sys 0m21.902s So the CPU usage is apparently halved, although the sending time has been reduced only slightly. By doubling the number of allowed sending threads I was able to get higher reduction in sending time: real0m32.553s user0m10.224s sys 0m20.732s top still shows 90%+ CPU usage though. Regards, mk ___ paramiko mailing list paramiko@lag.net http://www.lag.net/cgi-bin/mailman/listinfo/paramiko
[paramiko] Using invoke_shell to su root
Hi, Sometimes I need to su root and execute some command, I tried to use the chan = invoke_shell(), chan.send(su root) , wait the output and finally send the passwd. After that, I use the chan.send(whoami) to check if it's successful executed. Bu I found the behavior is a bit different from the formal exec_command() call, basically because of the channel management. For the exec_command style, seems like each time a new channel is produced, I can easily set a timeout to close it. But for the invoke_shell() style I need to reuse that channel and I can't simply close the channel, because if it's closed, then I need to invoke_shell() and su root again. So is there a way to su root only one time to make each exec_command take the advantage of root privilege? Thanks. -- : ~ ___ paramiko mailing list paramiko@lag.net http://www.lag.net/cgi-bin/mailman/listinfo/paramiko
Re: [paramiko] Using invoke_shell to su root
I'm also looking into the demo.py to get some inspirations. The input and output are in different thread, it's OK a command line usage. But how can I know whether the command's output recv() is totally complete? Is there a eof_received or command_output_eof like state or even a event to check? On Fri, Feb 5, 2010 at 11:33 AM, Wan Li wanli...@gmail.com wrote: On Fri, Feb 5, 2010 at 10:36 AM, Charles Duffy char...@dyfis.net wrote: Instead of needing to bother with chan.send(), just use exec_command() to invoke su - -c 'whatever_set_of_commands_you_need_to_run'. For instance, I have a helper I often use which uses sftp to upload a script into a temporary directory, and then over the same Transport uses exec_command() to run that script. You could do the same, using a single exec_command() call to run su with a command line which starts the script you uploaded, putting everything which needs to be run as root within that script. It's a nice solution, but the output of each step is very important for me and sometimes interactive inputs are required, so I think it will be hard to achieve my aim if using this solution. -- : ~ -- : ~ ___ paramiko mailing list paramiko@lag.net http://www.lag.net/cgi-bin/mailman/listinfo/paramiko