Bonjour, j'essaye de pouvoir communiquer avec un serveur grâce au module paramiko en python.
Cependant, j'obtiens l'erreur:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
Error reading SSH protocol banner
J'ai donc récupéré le log lors de l’exécution du serveur:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
DEBUG:paramiko.transport:starting thread (server mode): 0x38508f0L
DEBUG:paramiko.transport:Local version/idstring: SSH-2.0-paramiko_2.0.2
DEBUG:paramiko.transport:Remote version/idstring: SSH-2.0-paramiko_2.0.2
INFO:paramiko.transport:Connected (version 2.0, client paramiko_2.0.2)
DEBUG:paramiko.transport:kex algos:[u'diffie-hellman-group1-sha1', u'diffie-hellman-group14-sha1', u'diffie-hellman-group-exchange-sha1', u'diffie-hellman-group-exchange-sha256'] server key:[u'ssh-rsa', u'ssh-dss', u'ecdsa-sha2-nistp256', u'ecdsa-sha2-nistp384', u'ecdsa-sha2-nistp521'] client encrypt:[u'aes128-ctr', u'aes192-ctr', u'aes256-ctr', u'aes128-cbc', u'blowfish-cbc', u'aes192-cbc', u'aes256-cbc', u'3des-cbc', u'arcfour128', u'arcfour256'] server encrypt:[u'aes128-ctr', u'aes192-ctr', u'aes256-ctr', u'aes128-cbc', u'blowfish-cbc', u'aes192-cbc', u'aes256-cbc', u'3des-cbc', u'arcfour128', u'arcfour256'] client mac:[u'hmac-sha2-256', u'hmac-sha2-512', u'hmac-md5', u'hmac-sha1-96', u'hmac-md5-96', u'hmac-sha1'] server mac:[u'hmac-sha2-256', u'hmac-sha2-512', u'hmac-md5', u'hmac-sha1-96', u'hmac-md5-96', u'hmac-sha1'] client compress:[u'none'] server compress:[u'none'] client lang:[u''] server lang:[u''] kex follows?False
DEBUG:paramiko.transport:Kex agreed: diffie-hellman-group1-sha1
DEBUG:paramiko.transport:Cipher agreed: aes128-ctr
DEBUG:paramiko.transport:MAC agreed: hmac-sha2-256
DEBUG:paramiko.transport:Compression agreed: none
DEBUG:paramiko.transport:kex engine KexGroup1 specified hash_algo <built-in function openssl_sha1>
DEBUG:paramiko.transport:Switch to new keys ...
DEBUG:paramiko.transport:Auth request (type=password) service=ssh-connection, username=root
INFO:paramiko.transport:Auth granted (password).
DEBUG:paramiko.transport:[chan 0] Max packet in: 32768 bytes
DEBUG:paramiko.transport:[chan 0] Max packet out: 32768 bytes
DEBUG:paramiko.transport:Secsh channel 0 (session) opened.
et du coté client:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
2016-08-30 19:07:55,487 -- root -- DEBUG -- Debug error
2016-08-30 19:07:55,487 -- root -- INFO -- INFO ERROR
2016-08-30 19:07:55,487 -- root -- WARNING -- Warning Error 01234: Erreur Oracle
2016-08-30 19:07:55,487 -- root -- ERROR -- error message
2016-08-30 19:07:55,487 -- root -- CRITICAL -- critical error
2016-08-30 19:07:55,487 -- paramiko.transport -- DEBUG -- starting thread (client mode): 0x374ea10L
2016-08-30 19:07:55,487 -- paramiko.transport -- DEBUG -- Local version/idstring: SSH-2.0-paramiko_2.0.2
2016-08-30 19:07:55,487 -- paramiko.transport -- DEBUG -- Remote version/idstring: SSH-2.0-paramiko_2.0.2
2016-08-30 19:07:55,525 -- paramiko.transport -- INFO -- Connected (version 2.0, client paramiko_2.0.2)
2016-08-30 19:07:55,525 -- paramiko.transport -- DEBUG -- kex algos:[u'diffie-hellman-group1-sha1', u'diffie-hellman-group14-sha1'] server key:[u'ssh-rsa'] client encrypt:[u'aes128-ctr', u'aes192-ctr', u'aes256-ctr', u'aes128-cbc', u'blowfish-cbc', u'aes192-cbc', u'aes256-cbc', u'3des-cbc', u'arcfour128', u'arcfour256'] server encrypt:[u'aes128-ctr', u'aes192-ctr', u'aes256-ctr', u'aes128-cbc', u'blowfish-cbc', u'aes192-cbc', u'aes256-cbc', u'3des-cbc', u'arcfour128', u'arcfour256'] client mac:[u'hmac-sha2-256', u'hmac-sha2-512', u'hmac-md5', u'hmac-sha1-96', u'hmac-md5-96', u'hmac-sha1'] server mac:[u'hmac-sha2-256', u'hmac-sha2-512', u'hmac-md5', u'hmac-sha1-96', u'hmac-md5-96', u'hmac-sha1'] client compress:[u'none'] server compress:[u'none'] client lang:[u''] server lang:[u''] kex follows?False
2016-08-30 19:07:55,525 -- paramiko.transport -- DEBUG -- Kex agreed: diffie-hellman-group1-sha1
2016-08-30 19:07:55,525 -- paramiko.transport -- DEBUG -- Cipher agreed: aes128-ctr
2016-08-30 19:07:55,525 -- paramiko.transport -- DEBUG -- MAC agreed: hmac-sha2-256
2016-08-30 19:07:55,525 -- paramiko.transport -- DEBUG -- Compression agreed: none
2016-08-30 19:07:55,625 -- paramiko.transport -- DEBUG -- kex engine KexGroup1 specified hash_algo <built-in function openssl_sha1>
2016-08-30 19:07:55,625 -- paramiko.transport -- DEBUG -- Switch to new keys ...
2016-08-30 19:07:55,641 -- paramiko.transport -- DEBUG -- Adding ssh-rsa host key for 192.168.1.114: 60733844cb5186657fdedaa22b5a57d5
2016-08-30 19:07:55,641 -- paramiko.transport -- DEBUG -- userauth is OK
2016-08-30 19:07:55,641 -- paramiko.transport -- INFO -- Authentication (password) successful!
2016-08-30 19:07:55,657 -- paramiko.transport -- DEBUG -- [chan 0] Max packet in: 32768 bytes
2016-08-30 19:07:55,657 -- paramiko.transport -- DEBUG -- [chan 0] Max packet out: 32768 bytes
2016-08-30 19:07:55,657 -- paramiko.transport -- DEBUG -- Secsh channel 0 opened.
2016-08-30 19:08:09,250 -- paramiko.transport -- DEBUG -- starting thread (client mode): 0x38cf510L
2016-08-30 19:08:09,250 -- paramiko.transport -- DEBUG -- Local version/idstring: SSH-2.0-paramiko_2.0.2
2016-08-30 19:08:24,348 -- paramiko.transport -- ERROR -- Exception: Error reading SSH protocol banner
2016-08-30 19:08:24,352 -- paramiko.transport -- ERROR -- Traceback (most recent call last):
2016-08-30 19:08:24,354 -- paramiko.transport -- ERROR --   File "C:\Python27\lib\site-packages\paramiko\transport.py", line 1740, in run
2016-08-30 19:08:24,354 -- paramiko.transport -- ERROR --     self._check_banner()
2016-08-30 19:08:24,354 -- paramiko.transport -- ERROR --   File "C:\Python27\lib\site-packages\paramiko\transport.py", line 1888, in _check_banner
2016-08-30 19:08:24,355 -- paramiko.transport -- ERROR --     raise SSHException('Error reading SSH protocol banner' + str(e))
2016-08-30 19:08:24,355 -- paramiko.transport -- ERROR -- SSHException: Error reading SSH protocol banner
2016-08-30 19:08:24,355 -- paramiko.transport -- ERROR -- 
2016-08-30 19:08:27,134 -- paramiko.transport -- ERROR -- Socket exception: Une connexion existante a dû être fermée par l’hôte distant (10054)
2016-08-30 19:09:14,740 -- root -- DEBUG -- Debug error
2016-08-30 19:09:14,740 -- root -- INFO -- INFO ERROR
2016-08-30 19:09:14,740 -- root -- WARNING -- Warning Error 01234: Erreur Oracle
2016-08-30 19:09:14,740 -- root -- ERROR -- error message
2016-08-30 19:09:14,740 -- root -- CRITICAL -- critical error

J'ai recherché sur internet, et j'ai vu à certains endroits que le problème venait d'une mauvaise bannière SSH ne commençant pas par 'SSH-'. Cependant je ne sais pas comment la modifier. (Si vous voulez le code du programme python n'hésitez pas)
Merci de votre aide