ssh dss problem #2819
fifisoft57
started this conversation in
General
ssh dss problem
#2819
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
hello
I try to put a script for oneacces, at the connection I have an error of KEX ALGOS.
here is the log:
2022-06-16 15:31:20,742 IAD : 100.64.31.195 2022-06-16 15:31:20,766 starting thread (client mode): 0x15a82f40 2022-06-16 15:31:20,766 Local version/idstring: SSH-2.0-paramiko_2.11.0 2022-06-16 15:31:20,808 Remote version/idstring: SSH-2.0-OneSSH_3.9p1 2022-06-16 15:31:20,808 Connected (version 2.0, client OneSSH_3.9p1) 2022-06-16 15:31:20,829 === Key exchange possibilities === 2022-06-16 15:31:20,830 kex algos: diffie-hellman-group14-sha1, diffie-hellman-group1-sha1 2022-06-16 15:31:20,830 server key: ssh-dss 2022-06-16 15:31:20,830 client encrypt: aes128-cbc, 3des-cbc, aes192-cbc, aes256-cbc, aes128-ctr, aes192-ctr, aes256-ctr 2022-06-16 15:31:20,830 server encrypt: aes128-cbc, 3des-cbc, aes192-cbc, aes256-cbc, aes128-ctr, aes192-ctr, aes256-ctr 2022-06-16 15:31:20,830 client mac: hmac-md5, hmac-sha1, hmac-sha1-96, hmac-md5-96 2022-06-16 15:31:20,830 server mac: hmac-md5, hmac-sha1, hmac-sha1-96, hmac-md5-96 2022-06-16 15:31:20,830 client compress: none, zlib 2022-06-16 15:31:20,831 server compress: none, zlib 2022-06-16 15:31:20,831 client lang: <none> 2022-06-16 15:31:20,831 server lang: <none> 2022-06-16 15:31:20,831 kex follows: False 2022-06-16 15:31:20,831 === Key exchange agreements === 2022-06-16 15:31:20,831 Kex: diffie-hellman-group14-sha1 2022-06-16 15:31:20,831 HostKey: ssh-dss 2022-06-16 15:31:20,831 Cipher: aes128-ctr 2022-06-16 15:31:20,832 MAC: hmac-sha1 2022-06-16 15:31:20,832 Compression: none 2022-06-16 15:31:20,832 === End of kex handshake === 2022-06-16 15:31:21,499 Unknown exception: p must be exactly 1024, 2048, 3072, or 4096 bits long 2022-06-16 15:31:21,500 Traceback (most recent call last): 2022-06-16 15:31:21,500 File "paramiko\transport.py", line 2130, in run 2022-06-16 15:31:21,500 File "paramiko\kex_group1.py", line 75, in parse_next 2022-06-16 15:31:21,500 File "paramiko\kex_group1.py", line 120, in _parse_kexdh_reply 2022-06-16 15:31:21,500 File "paramiko\transport.py", line 1941, in _verify_key 2022-06-16 15:31:21,500 File "paramiko\dsskey.py", line 149, in verify_ssh_sig 2022-06-16 15:31:21,500 File "cryptography\hazmat\primitives\asymmetric\dsa.py", line 199, in public_key 2022-06-16 15:31:21,500 File "cryptography\hazmat\backends\openssl\backend.py", line 843, in load_dsa_public_numbers 2022-06-16 15:31:21,500 File "cryptography\hazmat\primitives\asymmetric\dsa.py", line 271, in _check_dsa_parameters 2022-06-16 15:31:21,500 ValueError: p must be exactly 1024, 2048, 3072, or 4096 bits long 2022-06-16 15:31:21,500
I can't force the following algos:
kex algos: diffie-hellman-group14-sha1, diffie-hellman-group1-sha1
with this command:
paramiko.Transport._preferred_kex = ('diffie-hellman-group14-sha1', 'diffie-hellman-group1-sha1')
here is my script:
`#!/usr/bin/env python
import logging
from ping3 import ping
from function import *
from netmiko import ConnectHandler, ssh_exception
import paramiko
Set to the specific algorithms you require
Create and configure logger
logging.basicConfig(filename="newfile.log",
format='%(asctime)s %(message)s',
filemode='w')
Creating an object
logger = logging.getLogger()
Setting the threshold of logger to DEBUG
logger.setLevel(logging.DEBUG)
device_list = []
for row in read_device_list():
device_dict = {
'host': row[1],
'device_type': "oneaccess_oneos",
'username': IAD_user,
'password': IAD_password,
'secret': IAD_password,
'system_host_keys': True,
'port': row[2],
}
device_list.append(device_dict)
print(device_list)
try:
for each_device in device_list:
###########################################
# Test de connexion a l'iad' #
###########################################
except ssh_exception.AuthenticationException:
print("Échec de l'authentification de l'hôte de saut")
except ssh_exception.NetmikoTimeoutException:
print("Hôte de saut non joignable")
`
Thank you for your help
Beta Was this translation helpful? Give feedback.
All reactions