• Document Up to Date

Debugging SSH Key Issues

In this section, we present a few errors that a user may encounter when using ssh keys with CrafterCMS and how to fix the errors.

SSH Unknown Host

When configuring a Deployer target to connect to a remote host through SSH you might encounter the following error:

Caused by: org.apache.sshd.common.SshException: Server key did not validate

This normally means that the server is not in the known_host file. To fix this run the following:

ssh-keyscan {server url} >> crafter-authoring/data/ssh/known_hosts

To test your SSH config, run the following:

ssh -F crafter-authoring/data/ssh/config -o UserKnownHostsFile=crafter-authoring/data/ssh/known_hosts -T {server url}

Remote Repository Not Found: USERAUTH fail

Here’s another error you may encounter in the logs when creating a site with a link to a remote repository using SSH keys:

org.apache.sshd.common.SshException: USERAUTH fail

This could mean that a passphrase was setup for the SSH keys. Crafter currently doesn’t support using a passphrase with SSH keys. To fix the error, remove the passphrase from the SSH key.

There are a couple of ways to remove the passphrase from the SSH key:

  1. Delete your existing key and generate a new key with NO PASSPHRASE.

  2. Or, another way is to run the following:

    $ ssh-keygen -p
    

    It will then prompt you to enter the keyfile location (CRAFTER_HOME/data/ssh by default), the old passphrase, and the new passphrase (leave this blank to have no passphrase).