Automation

 View Only
last person joined: 6 days ago 

Ask questions and share experiences about Apstra, Paragon, and all things network automation.

Negotiation failed: Error reading SSH protocol banner

  • 1.  Negotiation failed: Error reading SSH protocol banner

    This message was posted by a user wishing to remain anonymous
    Posted 08-18-2023 10:50
    This message was posted by a user wishing to remain anonymous

    Hello I am trying to query a juniper SRX340 that is behind a linux server that is configured with 2fa (PyEZ). I keep getting : 

    jnpr.junos.exception.ConnectError: ConnectError(host: jump-box, msg: Negotiation failed: Error reading SSH protocol banner)
    import jnpr
    import jnpr.junos.exception
    from lxml import etree
    from simple_colors import *

    hostname = input("Device hostname: ")
    junos_username = input("Junos OS username: ")
    device = jnpr.junos.Device(hostname,junos_username,ssh_config_file="~./ssh/config",auth_type="twofactor")

    device.open()

    output_ntp = device.rpc.get_ntp_associations_information()

    print (etree.tostring(output_ntp,encoding='unicode'))

    #print ("Hostname", (blue (device.facts['hostname'])))
    #print ("Model:" ,(blue (device.facts['model'])))
    #print ("Junos Version:", (blue (device.facts['version'])))
    device.close()
    I get prompt with a "verification code:" which makes me believe the authentication is working but after that it crashes with error: "Negotiation failed: Error reading SSH protocol banner"  it has a problem reading the ssh banner it seems. Anyone experienced something similar with ssh banners and PyEZ?