ropensci / cyphr

:shipit: Humane encryption
https://docs.ropensci.org/cyphr
Other
93 stars 10 forks source link

Allow `id_ed25519.pub` key file to be found as default SSH key #53

Open marianschmidt opened 1 year ago

marianschmidt commented 1 year ago

RStudio has changed the default generated SSH key to ED25519, which means that also the key file name changed and cannot be found by the default internal cyphr function openssl_find_pubkey. I would suggest to:

weshinsley commented 1 year ago

Thanks for reporting this:

For custom key names, you can set the environment variable USER_KEY to ~/.ssh/id_ed25519 and similarly USER_PUBKEY to ~/.ssh/id_ed25519.pub (for example) as an immediate workaround.

If id_ed25519 looks like being a common filename, then Cyphr could additionally look for that, as well as id_rsa.

marianschmidt commented 1 year ago

@weshinsley Thanks for your reply and for working on an implementation on new key types. I have just tried the workaround using the USER_KEY environment variables. This workaround fails for me during the step cyphr::data_admin_authorise (User used an ED25519 key. Admin uses RSA key.) with the following error message:

cyphr::data_admin_authorise(data_dir, yes = TRUE, path_user = ssh_admin_dir)

Error in openssl::rsa_encrypt(sym$key(), dat$pub) : 
  check failed: (inherits(pk, "rsa"))

Or is it a problem if the same user name requests access from different hosts?

Maybe this is also relevant for your new feature implementation.

weshinsley commented 1 year ago

This needs a change in the openssl package, to be able to encrypt the symmetric key with the different key... Still working on it...