1
0
-1

Hi,

somehow I cannot get ssh key creddentials to work. I generated a private and pubkey with puttygen. Afterwards I copied the private key into the field within the credential tab. Discovery gives out message that no credentials are found.

    CommentAdd your comment...

    2 answers

    1.  
      1
      0
      -1

      The only thing different I can see is that I do not use a root account. I use a regular user with sudo access. Try that?

        CommentAdd your comment...
      1.  
        1
        0
        -1

        There is no bug here. I use SSH keys in testing all the time.

        Maybe it's what you cut/pasted?

        Here's the wiki page on them - Credentials

        1. ToddeHB

          I did exactly as described in the Documentation. My private key looks like this

        2. Mark Unwin

          Most likely it is the remote device refusing the login. Check the Discovery Log.

          Stupid question, but you can login with this key from the command line, yes?

          ssh -v username@host

          You should see something like below.


          debug1: Authentications that can continue: publickey,password
          
          debug1: Next authentication method: publickey
          
          debug1: Offering public key: /Users/mark/.ssh/id_rsa RSA SHA256:UbeQQ...MvXZOi4 explicit agent
          
          debug1: Server accepts key: /Users/mark/.ssh/id_rsa RSA SHA256:UbeQQ...MvXZOi4 explicit agent
          
          Authenticated to dev ([192.168.20.5]:22) using "publickey".
        3. ToddeHB

          Discovery log just shows this:


          WarningNo valid credentials for 172.17.20.29
          Output: No valid credentials for 172.17.20.29


          Login in via ssh and privkey ist working

        4. Mark Unwin

          The discovery log is saying the target machine refused the connection.

          Please post the output (edited) of this command.

          ssh -v your_username@172.17.20.29

          Feel free to send me the discovery support output as per Open-AudIT Support Information

          to mark.unwin@firstwavecloud.com

        5. ToddeHB
           ssh -v root@172.17.20.29
          OpenSSH_9.2p1 Debian-2+deb12u2, OpenSSL 3.0.11 19 Sep 2023
          debug1: Reading configuration data /etc/ssh/ssh_config
          debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files
          debug1: /etc/ssh/ssh_config line 21: Applying options for *
          debug1: Connecting to 172.17.20.29 [172.17.20.29] port 22.
          debug1: Connection established.
          debug1: identity file /root/.ssh/id_rsa type -1
          debug1: identity file /root/.ssh/id_rsa-cert type -1
          debug1: identity file /root/.ssh/id_ecdsa type -1
          debug1: identity file /root/.ssh/id_ecdsa-cert type -1
          debug1: identity file /root/.ssh/id_ecdsa_sk type -1
          debug1: identity file /root/.ssh/id_ecdsa_sk-cert type -1
          debug1: identity file /root/.ssh/id_ed25519 type -1
          debug1: identity file /root/.ssh/id_ed25519-cert type -1
          debug1: identity file /root/.ssh/id_ed25519_sk type -1
          debug1: identity file /root/.ssh/id_ed25519_sk-cert type -1
          debug1: identity file /root/.ssh/id_xmss type -1
          debug1: identity file /root/.ssh/id_xmss-cert type -1
          debug1: identity file /root/.ssh/id_dsa type -1
          debug1: identity file /root/.ssh/id_dsa-cert type -1
          debug1: Local version string SSH-2.0-OpenSSH_9.2p1 Debian-2+deb12u2
          debug1: Remote protocol version 2.0, remote software version OpenSSH_9.2p1 Debian-2+deb12u2
          debug1: compat_banner: match: OpenSSH_9.2p1 Debian-2+deb12u2 pat OpenSSH* compat 0x04000000
          debug1: Authenticating to 172.17.20.29:22 as 'root'
          debug1: load_hostkeys: fopen /root/.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: sntrup761x25519-sha512@openssh.com
          debug1: kex: host key algorithm: ssh-ed25519
          debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
          debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
          debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
          debug1: SSH2_MSG_KEX_ECDH_REPLY received
          debug1: Server host key: ssh-ed25519 SHA256:O6vb9m2JxH+A04MTyt9zB7MkhA6JnQWYiOD4yuWpI+M
          debug1: load_hostkeys: fopen /root/.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 '172.17.20.29' is known and matches the ED25519 host key.
          debug1: Found key in /root/.ssh/known_hosts:1
          debug1: ssh_packet_send2_wrapped: resetting send seqnr 3
          debug1: rekey out after 134217728 blocks
          debug1: SSH2_MSG_NEWKEYS sent
          debug1: expecting SSH2_MSG_NEWKEYS
          debug1: ssh_packet_read_poll2: resetting read seqnr 3
          debug1: SSH2_MSG_NEWKEYS received
          debug1: rekey in after 134217728 blocks
          debug1: Will attempt key: /root/.ssh/id_rsa
          debug1: Will attempt key: /root/.ssh/id_ecdsa
          debug1: Will attempt key: /root/.ssh/id_ecdsa_sk
          debug1: Will attempt key: /root/.ssh/id_ed25519
          debug1: Will attempt key: /root/.ssh/id_ed25519_sk
          debug1: Will attempt key: /root/.ssh/id_xmss
          debug1: Will attempt key: /root/.ssh/id_dsa
          debug1: SSH2_MSG_EXT_INFO received
          debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,sk-ssh-ed25519@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,sk-ecdsa-sha2-nistp256@openssh.com,webauthn-sk-ecdsa-sha2-nistp256@openssh.com,ssh-dss,ssh-rsa,rsa-sha2-256,rsa-sha2-512>
          debug1: kex_input_ext_info: publickey-hostbound@openssh.com=<0>
          debug1: SSH2_MSG_SERVICE_ACCEPT received
          debug1: Authentications that can continue: publickey
          debug1: Next authentication method: publickey
          debug1: Trying private key: /root/.ssh/id_rsa
          Enter passphrase for key '/root/.ssh/id_rsa':
        CommentAdd your comment...