Skip to content

Instantly share code, notes, and snippets.

@natanlao
Last active February 22, 2024 21:03
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save natanlao/e920b9d8e2e6dee5a6d601ec94047eef to your computer and use it in GitHub Desktop.
Save natanlao/e920b9d8e2e6dee5a6d601ec94047eef to your computer and use it in GitHub Desktop.
Generating SSH keys that will work with Arq

Generating SSH keys with Arq

Tested with Arq 5.

I encountered some issues trying to add my existing SSH key pairs with Arq. I saw errors like:

[path to key]: Key 'OPENSSH' is not supported.

or

userauth publickey: Unable to extract public key from private key file: Wrong passphrase or invalid/unrecognized private key file format

or

DER length is '39' and cannot be more than 4 bytes

I found the following:

  • Arq only supports PEM-formatted keys
  • Arq does not support ed25519 keys (Arq uses libssh2 v1.7.x, ed25519 support is in libssh2 v1.8.x)

As such, generating keys a la

ssh-keygen -t rsa -b 4096 -a 100 -m PEM

worked for me.

You might also see that last error (DER length...) if the password to your private key is incorrect.

On Windows

On Windows, I encountered this error:

Invalid data type, INTEGER(02) is expected

I think this error was caused by protecting my generated SSH keys with extended ASCII characters. Removing these characters from my password seemed fixed the issue for me.

@scfcode
Copy link

scfcode commented Oct 25, 2022

I forked this and updated for Arq 7 (I only tried for macOS BTW, and it worked).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment