No announcement yet.

SSH private key not working

  • Filter
  • Time
  • Show
Clear All
new posts

  • SSH private key not working

    I've been trying for weeks to get Beyond Compare to work when an SSH private key is specified to no luck.

    Every time I try and connect I get the following error (and a password box):

    16/04/2019 10:44:50 No more authentication methods available
    16/04/2019 10:44:50 Connection failed: Connection lost (error code is 10058)

    I've tried everything (save password checked/unchecked, remove profile, new profile, default profile, etc).

    Any ideas?

  • #2
    Key troubleshooting is pretty tricky. Are you able to use the same key in another program to authenticate? One of the most common problems I run into is remembering to set the chmod correctly on the folder and the authorized_keys file on the server to allow them to be used.

    We have a KB article here. If you follow these steps (and regenerate the key as a troubleshooting step following this guide) does this work?
    Aaron P Scooter Software


    • #3
      The key works fine in other apps (Terminal & Transmit), it's just Beyond Compare which complains.

      I'm on macOS Mojave using Version 4.2.9 of BC.

      I've followed the steps on your site a few times, but still no luck. Any ideas on how to debug further?


      • #4
        I'd suggest attempting to regenerating a key following the above guide instructions and options, just in case the key itself is an issue somehow. If the newly generated pair works but the old key doesn't, that would be a different set of troubleshooting steps than if the new key also fails.
        Aaron P Scooter Software


        • #5
          I've followed the instructions again and still no luck. I can login using Terminal.


          • #6
            What OS is the SSH server running (Ubuntu 18.04, macOS 10.14.4, etc)?

            What is the output of sshd -V on the server?
            As an example, the output of the command on RHEL 7.6 is: OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017

            Is the SSH server using a default configuration (/etc/ssh/sshd_config on Linux), or is it customized?
            Chris K Scooter Software


            • #7
              The server is running Ubuntu 18.04.2.

              Here's the output you requested: OpenSSH_7.6p1 Ubuntu-4ubuntu0.3, OpenSSL 1.0.2n 7 Dec 2017

              As far as I'm aware it's a default setup.


              • #8
                Please email /etc/ssh/sshd_config from the server, your Beyond Compare settings, and a Beyond Compare log showing the failure to and we'll continue investigating.

                To save your Beyond Compare settings to a file on Mac, open Beyond Compare > Support, then click the Export button.

                After a connection fails in BC's Folder Compare, click the Save button on the left side of the log pane at the bottom of the window to save the log to a file.
                Chris K Scooter Software


                • #9
                  I also had the same problem on Mac OS Catalina.

                  But after using the [Create] button in the FTP Profile dialog to ** generate a new ** ssh keypair within Beyond Compare, I was able to access the SFTP url without being prompted for password when I used that new key instead of the one I generated myself on my Mac terminal.

                  I retained by the way the former ssh keypair to the server which allowed me to continue to ssh into my server without providing password. Besides that, I simply followed the instructions provided by the website here.


                  • #10

                    If you are able to send in any trouble keypair and other files Chris mentions, we could investigate what about it might be causing an issue. It's understandable if you are unable to send it in (and cannot if it is still being actively used anywhere), but if you've voided it from use and do not need it anymore, we can add it to our test cases.
                    Aaron P Scooter Software


                    • #11
                      Thanks Aaron.

                      On closer examination, I realised the key generated by BC (which works for me) is different from the one I self-generate on the mac (which does not work for me).

                      The BC generated RSA private key begins with

                      -----BEGIN RSA PRIVATE KEY------

                      The self-generated RSA private key on the Mac begins with
                      (generated at the terminal using $ ssh-keygen -b 4096)

                      -----BEGIN OPENSSH PRIVATE KEY-----
                      I then self generated using
                      $ ssh-keygen -m PEM -b 4096

                      And followed the instructions on the website here and now BC is working fine on the MAC OS for me.

                      Perhaps it is a key format issue. And if it is, BC can be made to recognise the PEM format or the instructions on the website can suggest creating an SSH key-pair with PEM compatible format.

                      Attached Files


                      • #12

                        Ah, that's a current known compatibility issue:

                        We're currently investigating and plan to support the key, but for now users will need to generate one in a supported format.
                        Aaron P Scooter Software


                        • #13
                          O did not know it was in KB already. Thanks and good to know - cheers


                          • #14
                            Ed25519 key support and OpenSSH private key format support were both added in Beyond Compare 4.4, available on the download page.
                            Chris K Scooter Software