Skip to content

Instantly share code, notes, and snippets.

@scfcode
Forked from natanlao/arq-ssh.md
Last active October 25, 2022 00:19
Show Gist options
  • Save scfcode/5f389b5ac45aaa97b5622e3dd0273ff7 to your computer and use it in GitHub Desktop.
Save scfcode/5f389b5ac45aaa97b5622e3dd0273ff7 to your computer and use it in GitHub Desktop.
Generating SSH keys that will work with Arq #Arq #Backup #macos

Generating SSH keys with Arq

Tested with Arq 7 (had been seen by original gist author with Arq 5).

The original author encountered some issues trying to add my existing SSH key pairs with Arq. He 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

He 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 both Arq 5 and 7 (6 untested at this time)

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

(I scf.code: saw the userauth error with my Arq 7 sftp setup, this gist fixed that I also found https://nitter.unixfox.eu/arqbackup/status/705700435282272256).

On Windows

On Windows, the orgininal author encountered this error:

Invalid data type, INTEGER(02) is expected

He thought 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
Author

scfcode commented Oct 25, 2022

Note I did not try Arq 5. I also didn't try Windows for that concern/issue.

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