[paramiko] su: must be run from a terminal

Eri Ramos Bastos bastos.eri at gmail.com
Mon Nov 9 11:31:59 PST 2009


Got it working.

The problem seems to be related to the server slow response. I fixed
by doing this:

        while not shell.recv_ready():
            time.sleep(1)

        data = shell.recv(2048)
        print data

Thanks a lot!

[]'s
Eri Ramos Bastos

On Mon, Nov 9, 2009 at 11:46 AM, Eric Noulard <eric.noulard at gmail.com> wrote:
> 2009/11/9 Eri Ramos Bastos <bastos.eri at gmail.com>:
>> Thanks, Eric.
>> I'm still struggling, though.
>
> could you try
> shell = client.invoke_shell(term='vt100', width=80, height=24)
>
> i.e. 'vt100' instead of 'xterm'.
>
> Then just after that could you try reading with
>
> print shell.recv(1)
>
> until there is nothing to be read. Just after you request a shell
> you should get output from it BEFORE sending anything just as
> you do when you login into any system with a login shell.
>
> If you do not read this first output
> your pty input  may be stalled because
> you did not read enough  output from it first.
>
> You can do this in an interactive python shell in order to experiment
> more easily.
>
>>> Sys Admin and programmers are not living far away from each other.
>>> You'll be soon be speaking Greek fluently :-)
>>
>> Yeah... I started use Python due to bash script limitations and I loved it. ;)
>> Still having problems like understanding documentation, but I'll learn
>> sooner or latter.
>
> Sure you will.
>
> --
> Erk
> Membre de l'April - « promouvoir et défendre le logiciel libre » -
> http://www.april.org
>



More information about the paramiko mailing list