b b | 8 Aug 20:13 2010
Picon

Re: Paramiko hangs



On Sun, Aug 8, 2010 at 6:54 PM, Eric Noulard <eric.noulard <at> gmail.com> wrote:
2010/8/8 b b <borique <at> gmail.com>:
> Hi,
> thanks for your answer.
> I tried couple of examples from internet, also with authentication with
> password and also with rsa. In every example it hangs. I tried what you
> wrote and here is the result:
>>>> import paramiko
> /opt/local/lib/python2.6/site-packages/Crypto/Util/randpool.py:40:
> RandomPool_DeprecationWarning: This application uses RandomPool, which is
> BROKEN in older releases.  See http://www.pycrypto.org/randpool-broken
>   RandomPool_DeprecationWarning)
>>>> client = paramiko.SSHClient()
>>>> client.load_system_host_keys()
>>>> client.connect('192.168.11.11')
> now it hangs 
 
You should at least put a username in your connect statement.

yes that's correct, but there is no change if I use username and password, it hangs on the same position 
This may work if you are using agent based + public authentication.
If not then you must add a password or explicit public key.
But those example are using username and either passwd or public key
and your example does not show you are.

> I have no idea, what the problem is. I get no exception, no error or
> traceback. It just hangs...

Are you running a script or are doing you test interactively?
interactively, but I tried also as a script, with no success 
The "hang" you see may be due to paramiko's background thread
preventing the termination of the python interpreter:
cf http://www.mail-archive.com/paramiko <at> lag.net/msg00373.html

that would be probably my case, after I kill my python with ctrl+z and do ps I can see some python processes running
I have now the latest revision installed.
Should I try it not interactively but instead as a script? From that threat it's not so clear for me what should I do.
But I already tried it also as a script and it didn't help.
I'm little bit confused....

Thanks for your help.
 
PS: please keep cc the list, that way others may get a chance to answer
     your question as well.

--
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org

_______________________________________________
paramiko mailing list
paramiko <at> lag.net
http://www.lag.net/cgi-bin/mailman/listinfo/paramiko
Eric Noulard | 8 Aug 22:19 2010
Picon

Re: Paramiko hangs

2010/8/8 b b <borique <at> gmail.com>:
>
>
> On Sun, Aug 8, 2010 at 6:54 PM, Eric Noulard <eric.noulard <at> gmail.com> wrote:
>>
>> 2010/8/8 b b <borique <at> gmail.com>:
>> > Hi,
>> > thanks for your answer.
>> > I tried couple of examples from internet, also with authentication with
>> > password and also with rsa. In every example it hangs. I tried what you
>> > wrote and here is the result:
>> >>>> import paramiko
>> > /opt/local/lib/python2.6/site-packages/Crypto/Util/randpool.py:40:
>> > RandomPool_DeprecationWarning: This application uses RandomPool, which
>> > is
>> > BROKEN in older releases.  See http://www.pycrypto.org/randpool-broken
>> >   RandomPool_DeprecationWarning)
>> >>>> client = paramiko.SSHClient()
>> >>>> client.load_system_host_keys()
>> >>>> client.connect('192.168.11.11')
>> > now it hangs
>>
>>
>>
>> You should at least put a username in your connect statement.
>>
> yes that's correct, but there is no change if I use username and password,
> it hangs on the same position
>>
>> This may work if you are using agent based + public authentication.
>> If not then you must add a password or explicit public key.
>>
>> > here are the examples I already tried:
>> > http://segfault.in/2010/03/paramiko-ssh-and-sftp-with-python/
>> >
>> > http://code.activestate.com/recipes/576810-copy-files-over-ssh-using-paramiko/
>> > http://commandline.org.uk/python/sftp-python/
>>
>> But those example are using username and either passwd or public key
>> and your example does not show you are.
>>
>> > I have no idea, what the problem is. I get no exception, no error or
>> > traceback. It just hangs...
>>
>> Are you running a script or are doing you test interactively?
>
> interactively, but I tried also as a script, with no success

Then hang problem should be with a script
or when trying to exit interactive session.

During an interactive session the call to connect() should either
throw an exception or return.

If the call does not return there is another problem.

>> The "hang" you see may be due to paramiko's background thread
>> preventing the termination of the python interpreter:
>> cf http://www.mail-archive.com/paramiko <at> lag.net/msg00373.html
>>
> that would be probably my case, after I kill my python with ctrl+z and do ps
> I can see some python processes running

Ctrl+Z does not terminate the process it suspends it.
You should kill -TERM the suspended process to effectively terminate
the process.

> I have now the latest revision installed.
> Should I try it not interactively but instead as a script?

interactively is fine.

> From that threat it's not so clear for me what should I do.
> But I already tried it also as a script and it didn't help.
> I'm little bit confused....

From what you say your problem seems different.
Could you try to connect on "localhost" or "127.0.0.1" instead
of the other machine.

May be there is an SSH compatibilty problem with the remote host.
You talk about "busybox, synology" as far as I know busybox does not
include an SSH server. (sometimes dropbear is added to busybox
on embedded systems).

I don't know "synology".
What is this "synology" system? Is it the host your are connecting to
(ssh server XXX) or the host your are connecting from (paramiko client).

--

-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org
b b | 8 Aug 22:33 2010
Picon

Re: Paramiko hangs



On Sun, Aug 8, 2010 at 10:19 PM, Eric Noulard <eric.noulard <at> gmail.com> wrote:
2010/8/8 b b <borique <at> gmail.com>:
>
>
> On Sun, Aug 8, 2010 at 6:54 PM, Eric Noulard <eric.noulard <at> gmail.com> wrote:
>>
>> 2010/8/8 b b <borique <at> gmail.com>:
>> > Hi,
>> > thanks for your answer.
>> > I tried couple of examples from internet, also with authentication with
>> > password and also with rsa. In every example it hangs. I tried what you
>> > wrote and here is the result:
>> >>>> import paramiko
>> > /opt/local/lib/python2.6/site-packages/Crypto/Util/randpool.py:40:
>> > RandomPool_DeprecationWarning: This application uses RandomPool, which
>> > is
>> > BROKEN in older releases.  See http://www.pycrypto.org/randpool-broken
>> >   RandomPool_DeprecationWarning)
>> >>>> client = paramiko.SSHClient()
>> >>>> client.load_system_host_keys()
>> >>>> client.connect('192.168.11.11')
>> > now it hangs
>>
>>
>>
>> You should at least put a username in your connect statement.
>>
> yes that's correct, but there is no change if I use username and password,
> it hangs on the same position
>>
>> This may work if you are using agent based + public authentication.
>> If not then you must add a password or explicit public key.
>>
>> > here are the examples I already tried:
>> > http://segfault.in/2010/03/paramiko-ssh-and-sftp-with-python/
>> >
>> > http://code.activestate.com/recipes/576810-copy-files-over-ssh-using-paramiko/
>> > http://commandline.org.uk/python/sftp-python/
>>
>> But those example are using username and either passwd or public key
>> and your example does not show you are.
>>
>> > I have no idea, what the problem is. I get no exception, no error or
>> > traceback. It just hangs...
>>
>> Are you running a script or are doing you test interactively?
>
> interactively, but I tried also as a script, with no success

Then hang problem should be with a script
or when trying to exit interactive session.

During an interactive session the call to connect() should either
throw an exception or return.

If the call does not return there is another problem.

>> The "hang" you see may be due to paramiko's background thread
>> preventing the termination of the python interpreter:
>> cf http://www.mail-archive.com/paramiko <at> lag.net/msg00373.html
>>
> that would be probably my case, after I kill my python with ctrl+z and do ps
> I can see some python processes running

Ctrl+Z does not terminate the process it suspends it.
You should kill -TERM the suspended process to effectively terminate
the process.

> I have now the latest revision installed.
> Should I try it not interactively but instead as a script?

interactively is fine.

> From that threat it's not so clear for me what should I do.
> But I already tried it also as a script and it didn't help.
> I'm little bit confused....

From what you say your problem seems different.
Could you try to connect on "localhost" or "127.0.0.1" instead
of the other machine.

already tried, same result
 
May be there is an SSH compatibilty problem with the remote host.
You talk about "busybox, synology" as far as I know busybox does not
include an SSH server. (sometimes dropbear is added to busybox
on embedded systems).

I don't know "synology".
What is this "synology" system? Is it the host your are connecting to
(ssh server XXX) or the host your are connecting from (paramiko client).


synology is a nas station, http://www.synology.com 
and there is a linux system (busybox) running on it with some hacks done by the company which sells it
of course you can hack it itself - there are a lot of forums and wikis
for modding i'm using ipkg manager and source from :  http://ipkg.nslu2-linux.org/feeds/optware/syno-x07/cross/unstable/Packages.gz
so this way i installed the ssh apps:
openssh - 5.5p1-1 - a FREE version of the SSH protocol suite of network connectivity tools.
openssh-sftp-server - 5.5p1-1 - sftp-server only from a FREE version of the SSH protocol suite of network connectivity tools.
openssl - 0.9.7m-5 - Openssl provides the ssl implementation in libraries libcrypto and libssl, and is needed by many other applications and librari
so that's where I have ssh from...

thanks again for your support
--
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org

_______________________________________________
paramiko mailing list
paramiko <at> lag.net
http://www.lag.net/cgi-bin/mailman/listinfo/paramiko

Gmane