P
P
Pavel Shvedov2014-11-25 23:12:05
Python
Pavel Shvedov, 2014-11-25 23:12:05

Why doesn't paramiko connect using Public Key?

Good day to all! The question is, I am writing a python utility for manipulating remote machines via SSH. There is a functionality for adding a remote machine, while entering a login / password, then connecting using this data, we write on the server in ~/.ssh/authorized_keys our local id_rsa.pub . Everything goes ok, I check with my hands, I connect from the console without a password, my public key is normally in authorized_keys . But, further, in the application I connect in the same way (but without passing the password to the connect method) I try to connect to a remote machine, implying the use of a public key. log output to the console

[2014-11-25 20:03:33,079: INFO/Worker-1] Connected (version 2.0, client OpenSSH_5.3)
[2014-11-25 20:03:33,580: INFO/Worker-1] Authentication (publickey) successful!
[2014-11-25 20:03:34,750: INFO/Worker-1] Connected (version 2.0, client OpenSSH_6.4)
[2014-11-25 20:03:36,581: INFO/Worker-1] Authentication (publickey) failed.
[2014-11-25 20:03:37,380: INFO/Worker-1] Authentication (publickey) failed.
[2014-11-25 20:03:37,810: INFO/Worker-1] Authentication (password) failed.

Why, after the first successful attempt to log in, does it make several more attempts, and then throw AuthenticationException: Authentication failed ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Petrikov, 2014-11-26
@RicoX

Personally, it confuses me in your log that in case of a successful connection, the version of the client is OpenSSH_5.3, and in case of an error it is OpenSSH_6.4, it turns out that different clients connect and OpenSSH_6.4 simply does not see the key, you need to look at the config from this client version.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question