Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

I'm having an issue where ssh is somehow failing.

At first the key exchange methods werent available, and after solving that issue, I now run into this.

ssh_dispatch_run_fatal: Connection to x.x.x.x port 22: error in libcrypto

Since this issue is probably very specific, I can't seem to find a solution that works.

This is the config file I used to solve my first issue:

Host x.x.x.x
        KexAlgorithms +diffie-hellman-group14-sha1
        HostKeyAlgorithms +ssh-rsa
        PubkeyAcceptedAlgorithms +ssh-rsa

I'm running a Rocky client to connect to a CRS1000v router. These are all virtual, and ssh is already set up.

Note:

  • SSH from my windows machine is working just fine
  • I can't adjust the router, as this gets setup using Ansible. This would defeat the purpose.
  • Error log

    OpenSSH_8.7p1, OpenSSL 3.0.1 14 Dec 2021
    debug1: Reading configuration data /home/student/.ssh/config
    debug1: /home/student/.ssh/config line 1: Applying options for x.x.x.x
    debug1: Reading configuration data /etc/ssh/ssh_config
    debug1: Reading configuration data /etc/ssh/ssh_config.d/50-redhat.conf
    debug1: Reading configuration data /etc/crypto-policies/back-ends/openssh.config
    debug1: configuration requests final Match pass
    debug1: re-parsing configuration
    debug1: Reading configuration data /home/student/.ssh/config
    debug1: /home/student/.ssh/config line 1: Applying options for x.x.x.x
    debug1: Reading configuration data /etc/ssh/ssh_config
    debug1: Reading configuration data /etc/ssh/ssh_config.d/50-redhat.conf
    debug1: Reading configuration data /etc/crypto-policies/back-ends/openssh.config
    debug1: Connecting to x.x.x.x [x.x.x.x] port 22.
    debug1: Connection established.
    debug1: identity file /home/student/.ssh/id_rsa type 0
    debug1: identity file /home/student/.ssh/id_rsa-cert type -1
    debug1: identity file /home/student/.ssh/id_dsa type -1
    debug1: identity file /home/student/.ssh/id_dsa-cert type -1
    debug1: identity file /home/student/.ssh/id_ecdsa type -1
    debug1: identity file /home/student/.ssh/id_ecdsa-cert type -1
    debug1: identity file /home/student/.ssh/id_ecdsa_sk type -1
    debug1: identity file /home/student/.ssh/id_ecdsa_sk-cert type -1
    debug1: identity file /home/student/.ssh/id_ed25519 type -1
    debug1: identity file /home/student/.ssh/id_ed25519-cert type -1
    debug1: identity file /home/student/.ssh/id_ed25519_sk type -1
    debug1: identity file /home/student/.ssh/id_ed25519_sk-cert type -1
    debug1: identity file /home/student/.ssh/id_xmss type -1
    debug1: identity file /home/student/.ssh/id_xmss-cert type -1
    debug1: Local version string SSH-2.0-OpenSSH_8.7
    debug1: Remote protocol version 1.99, remote software version Cisco-1.25
    debug1: compat_banner: match: Cisco-1.25 pat Cisco-1.* compat 0x60000000
    debug1: Authenticating to x.x.x.x:22 as 'cisco'
    debug1: load_hostkeys: fopen /home/student/.ssh/known_hosts2: No such file or directory
    debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory
    debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory
    debug1: SSH2_MSG_KEXINIT sent
    debug1: SSH2_MSG_KEXINIT received
    debug1: kex: algorithm: diffie-hellman-group14-sha1
    debug1: kex: host key algorithm: ssh-rsa
    debug1: kex: selibcryptorver->client cipher: aes256-ctr MAC: hmac-sha2-256 compression: none
    debug1: kex: client->server cipher: aes256-ctr MAC: hmac-sha2-256 compression: none
    debug1: kex: diffie-hellman-group14-sha1 need=32 dh_need=32
    debug1: kex: diffie-hellman-group14-sha1 need=32 dh_need=32
    debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
    debug1: SSH2_MSG_KEX_ECDH_REPLY received
    debug1: Server host key: ssh-rsa SHA256:BgNFRrSvO+r2m8+MzUNlS5GdzXPJmyW2jeyt2NkzY3o
    debug1: load_hostkeys: fopen /home/student/.ssh/known_hosts2: No such file or directory
    debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory
    debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory
    debug1: Host 'x.x.x.x' is known and matches the RSA host key.
    debug1: Found key in /home/student/.ssh/known_hosts:9
    ssh_dispatch_run_fatal: Connection to x.x.x.x port 22: error in libcrypto
                    Stackoverflow is for questions about programming or software development, which this is not. IF you are using recent RedHat or related Linux (like CentOS) see serverfault.com/questions/1125843/… and serverfault.com/questions/1110463/… where it is ontopic.
    – dave_thompson_085
                    Apr 30 at 18:45
                    @dave_thompson_085 I didnt know there was a difference :-p Anyways, thanks for the rescource, this fixed my issue whilest helping me understand why it broke! Have a nice day!
    – Amparo Walter
                    Apr 30 at 19:54
            

    Thanks for contributing an answer to Stack Overflow!

    • Please be sure to answer the question. Provide details and share your research!

    But avoid

    • Asking for help, clarification, or responding to other answers.
    • Making statements based on opinion; back them up with references or personal experience.

    To learn more, see our tips on writing great answers.