Greetings all, help solve the problem: there is a code

if switch in zhone: zhone_ip = zhone[switch] print (zhone_ip) paramiko.common.logging.basicConfig(level=paramiko.common.DEBUG) ssh = paramiko.SSHClient() ssh.set_missing_host_key_policy(paramiko.RejectPolicy()) ssh.connect(hostname=zhone_ip, port=22, username='admin', password='zhone') channel = ssh.get_transport().open_session() channel.get_pty() channel.settimeout(5) channel.exec_command('onu status 1/7/52') print (channel.recv(1024)) channel.close() ssh.close() ` 

here is the exit:

  172.20.0.7 DEBUG:paramiko.transport:starting thread (client mode): 0x3dbd41d0 DEBUG:paramiko.transport:Local version/idstring: SSH-2.0-paramiko_2.0.1 DEBUG:paramiko.transport:Remote version/idstring: SSH-2.0-Mocana SSH INFO:paramiko.transport:Connected (version 2.0, client Mocana) DEBUG:paramiko.transport:kex algos:['diffie-hellman-group14-sha1', 'diffie-hellman-group1-sha1'] server key:['ssh-dss'] client encrypt:['aes256-cbc', 'rijndael256-cbc', 'aes192-cbc', 'rijndael192-cbc', 'aes128-cbc', 'rijndael128-cbc', '3des-cbc', 'arcfour'] server encrypt:['aes256-cbc', 'rijndael256-cbc', 'aes192-cbc', 'rijndael192-cbc', 'aes128-cbc', 'rijndael128-cbc', '3des-cbc', 'arcfour'] client mac:['hmac-sha1', 'hmac-sha1-96', 'hmac-md5', 'hmac-md5-96'] server mac:['hmac-sha1', 'hmac-sha1-96', 'hmac-md5', 'hmac-md5-96'] client compress:['none'] server compress:['none'] client lang:[''] server lang:[''] kex follows?False DEBUG:paramiko.transport:Kex agreed: diffie-hellman-group1-sha1 DEBUG:paramiko.transport:Cipher agreed: aes128-cbc DEBUG:paramiko.transport:MAC agreed: hmac-md5 DEBUG:paramiko.transport:Compression agreed: none ERROR:paramiko.transport:Unknown exception: p must be exactly 1024, 2048, or 3072 bits long ERROR:paramiko.transport:Traceback (most recent call last): ERROR:paramiko.transport: File "/home/kocik/python/xls/xls/lib/python3.5/site-packages/paramiko/transport.py", line 1772, in run ERROR:paramiko.transport: self.kex_engine.parse_next(ptype, m) ERROR:paramiko.transport: File "/home/kocik/python/xls/xls/lib/python3.5/site-packages/paramiko/kex_group1.py", line 75, in parse_next ERROR:paramiko.transport: return self._parse_kexdh_reply(m) ERROR:paramiko.transport: File "/home/kocik/python/xls/xls/lib/python3.5/site-packages/paramiko/kex_group1.py", line 111, in _parse_kexdh_reply ERROR:paramiko.transport: self.transport._verify_key(host_key, sig) ERROR:paramiko.transport: File "/home/kocik/python/xls/xls/lib/python3.5/site-packages/paramiko/transport.py", line 1620, in _verify_key ERROR:paramiko.transport: if not key.verify_ssh_sig(self.H, Message(sig)): ERROR:paramiko.transport: File "/home/kocik/python/xls/xls/lib/python3.5/site-packages/paramiko/dsskey.py", line 153, in verify_ssh_sig ERROR:paramiko.transport: ).public_key(backend=default_backend()) ERROR:paramiko.transport: File "/home/kocik/python/xls/xls/lib/python3.5/site-packages/cryptography/hazmat/primitives/asymmetric/dsa.py", line 194, in public_key ERROR:paramiko.transport: return backend.load_dsa_public_numbers(self) ERROR:paramiko.transport: File "/home/kocik/python/xls/xls/lib/python3.5/site-packages/cryptography/hazmat/backends/multibackend.py", line 198, in load_dsa_public_numbers ERROR:paramiko.transport: return b.load_dsa_public_numbers(numbers) ERROR:paramiko.transport: File "/home/kocik/python/xls/xls/lib/python3.5/site-packages/cryptography/hazmat/backends/openssl/backend.py", line 702, in load_dsa_public_numbers ERROR:paramiko.transport: dsa._check_dsa_parameters(numbers.parameter_numbers) ERROR:paramiko.transport: File "/home/kocik/python/xls/xls/lib/python3.5/site-packages/cryptography/hazmat/primitives/asymmetric/dsa.py", line 120, in _check_dsa_parameters ERROR:paramiko.transport: raise ValueError("p must be exactly 1024, 2048, or 3072 bits long") ERROR:paramiko.transport:ValueError: p must be exactly 1024, 2048, or 3072 bits long 

What is the problem I do not understand, can you tell me?

Closed due to the fact that the question is too general for the user194374, cheops , Streletz , aleksandr barakin , fori1ton 6 Jul '16 at 8:16 .

Please correct the question so that it describes the specific problem with sufficient detail to determine the appropriate answer. Do not ask a few questions at once. See “How to ask a good question?” For clarification. If the question can be reformulated according to the rules set out in the certificate , edit it .

  • 3
  • one
    Try to give minimal but complete code examples and the corresponding verbal description of what the code should do and what happens instead (what exactly is the conclusion that differs from the desired one and which of the several possible problems you are interested in). A more informative header doesn’t hurt: “Trying to ssh on a zphone using paramiko 2 results in ValueError: p must be exactly 1024, 2048, or 3072 bits long” - jfs

0