Articles in this section

Unable to save a new key in SSH Keys Manager: Incorrect format of SSH public key

kb: technical ext: ssh-keys

Symptoms

Domains > example.com > SSH Keys > Add Key returns the following error:

Incorrect format of SSH public key

Cause

A previous key was saved with an incorrect format in /var/www/vhosts/example.com/.ssh/authorized_keys. This was probably done via SSH and not via UI.

ssh-ed25519 BBBBBBC3NzaC1lZDI1NTE5AAAAIFW+K5cmRAQUjUtvVJAwqA+xGLam/FTUuOAOMLVIc925

The key is expected to have three space-separated non-whitespace parts (type, key, title):

ssh-ed25519 BBBBBBC3NzaC1lZDI1NTE5AAAAIFW+K5cmRAQUjUtvVJAwqA+xGLam/FTUuOAOMLVIc925 johndoe

Resolution

  1. Connect to the server via SSH

  2. Since the key is already saved in the file system the following file needs to be edited. Edit file /var/www/vhosts/example.com/.ssh/authorized_keys

  3. Remove the key with the incorrect format or modify it so there are three space-separated non-whitespace parts (type, key, title)  and save the file.

  4. Verify that the error is gone in Domains > example.com > SSH Keys

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.