SFTP Private Key Authentication
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
ssh-keygen -t ed25519 -C "Comment"
- Enter to save key as
~/.ssh/id_ed25519
- Enter a passphrase if desired.
chmod 700 ~/.ssh
cat ~/.ssh/id_ed25519.pub >> ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys
Generate Private Key on Linux Server - BC 4.3.7 or Older
ssh-keygen -m PEM -t rsa -C "Comment"
- Enter to save key as
~/.ssh/id_rsa
- Enter a passphrase if desired.
chmod 700 ~/.ssh
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
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
- Copy private key
~/.ssh/id_ed25519
or~/.ssh/id_rsa
to a folder on the local PC. - On Windows or Linux, open Tools > Profiles. On macOS open Beyond Compare > Profiles.
- Click + to create a new profile.
- Select FTP Profile.
- Go to the Login tab.
- Select SFTP (SSH2) as the protocol.
- Enter Host and Username.
- Leave Password blank and uncheck Save Password.
- In the SSH private key file field, click the browse button and select the private key copied from the Linux server (
id_ed25519
orid_rsa
). - Save the profile.
- In the Folder Compare, click the browse button.
- Select the saved profile of your SFTP server and click OK.
- Enter a passphrase for the private key if required.
Configure Beyond Compare 3 Pro to Use the Private Key
- Copy private key
~/.ssh/id_rsa
to a folder on the local PC. - Open Tools > FTP Profiles.
- Click New to create a new profile.
- Go to the General tab.
- Select SFTP (SSH2) as the protocol.
- Enter Host and Username.
- Leave Password blank and check Save Password.
- Go to the Authentication tab.
- 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
). - Enter a passphrase for the private key if required.
- Save the profile.
- In the Folder Compare, click the browse button.
- Go to the FTP Site tab.
- Click the Profile dropdown, select the profile of your SFTP server and click OK.