[paramiko] SSHClient.exec_command , ChannelException: Administratively prohibited

James Bardin jbardin at bu.edu
Thu Dec 20 12:25:28 PST 2007


thk wrote:
>>>  
>> I think that's the server throttling your number of channels.
>
> But aren't the channels closing?
>
I would think so, but maybe the server takes longer to give up on the 
connections. "Administratively prohibited" is a failure code from the 
server, so I would look at the server logs (in debug if you can).

> Thanks for the reply.
> Basically i am looking for a non blocking way to execute commands on 
> the server.
> I believe if i use interactive_shell I have to implement it with 
> threads so I can code a non blocking function , because these methods 
> block ?

But won't anything with a read() be blocking? If read() would block 
because the server is still sending data, you would need a new channel 
anyways.

>
> So one alternative is to do a transport connect and the in each loop 
> get  a new channel with  t.open_session()?
>
This is exactly what exec_command is doing, so I don't think it would help.

If you're not on windows, maybe you could use select.select() (python 
module) to check the status of the stdout so you don't need to go into a 
blocking state to read??

-jim




More information about the paramiko mailing list