SFTP Private Key Authentication

Pro only BC3 logo BC Version 3 or later, Pro Edition only

Beyond Compare Pro Edition version 3 and newer allows you to authenticate an SFTP connection using a private key file instead of a password.

Generate Private Key on Linux Server - BC 4.4 or Newer

  1. ssh-keygen -t ed25519 -C "Comment"
  2. Enter to save key as ~/.ssh/id_ed25519
  3. Enter a passphrase if desired.
  4. chmod 700 ~/.ssh
  5. cat ~/.ssh/id_ed25519.pub >> ~/.ssh/authorized_keys
  6. chmod 600 ~/.ssh/authorized_keys

Generate Private Key on Linux Server - BC 4.3.7 or Older

  1. ssh-keygen -m PEM -t rsa -C "Comment"
  2. Enter to save key as ~/.ssh/id_rsa
  3. Enter a passphrase if desired.
  4. chmod 700 ~/.ssh
  5. cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
  6. chmod 600 ~/.ssh/authorized_keys

See the article Redhat Enterprise Linux 6 Deployment Guide - Generating Key Pairs for a more detailed guide to generating private keys.

Configure Beyond Compare 4 or 5 Pro to Use the Private Key

  1. Copy private key ~/.ssh/id_ed25519 or ~/.ssh/id_rsa to a folder on the local PC.
  2. On Windows or Linux, open Tools | Profiles.  On macOS open Beyond Compare | Profiles.
  3. Click + to create a new profile.
  4. Select FTP Profile.
  5. Go to the Login tab.
  6. Select SFTP (SSH2) as the protocol.
  7. Enter Host and Username.
  8. Leave Password blank and uncheck Save Password.
  9. In the SSH private key file field, click the browse button and select the private key copied from the Linux server (id_ed25519 or id_rsa).
  10. Save the profile.
  11. In the Folder Compare, click the browse button.
  12. Select the saved profile of your SFTP server and click OK.
  13. Enter a passphrase for the private key if required.

Configure Beyond Compare 3 Pro to Use the Private Key

  1. Copy private key ~/.ssh/id_rsa to a folder on the local PC.
  2. Open Tools | FTP Profiles.
  3. Click New to create a new profile.
  4. Go to the General tab.
  5. Select SFTP (SSH2) as the protocol.
  6. Enter Host and Username.
  7. Leave Password blank and check Save Password.
  8. Go to the Authentication tab.
  9. In the SSH public key authentication: Private key file field, click the browse button and select the private key copied from the Linux server (id_rsa).
  10. Enter a passphrase for the private key if required.
  11. Save the profile.
  12. In the Folder Compare, click the browse button.
  13. Go to the FTP Site tab.
  14. Click the Profile dropdown, select the profile of your SFTP server and click OK.