-
Notifications
You must be signed in to change notification settings - Fork 22
Description
Hello, I have a multitenant system where we pull in data via sftp for processing, everything works very well, with passwords, but with private_keys, I have a probem.
I see the options:
* `:user_dir` - The directory to read private keys from.
* `:private_key_path` - The path to the private key to use for authentication.
* `:key_cb` - A 2-item tuple containing:
- A module that implements `:ssh_client_key_api` behaviour.
- `:ssh_client_key_api` behaviour opts.
might be helpful when using private keys. user_dir is unlikely to be helpful in my case given we don't have user_dir for each user.
I am trying to use: :private_key_path - so I store the private key in a temp file and using this attribute send that with the options, however, I get:
connection_result: {:error,
%SFTPClient.ConnError{
message: "Unable to connect using the available authentication methods"
}}
I have also tried to use: {:key_cb, {AvkService.SSHApi.DatabaseClientKey, private_key: auth_secret}}and then override def user_key(algorithm, opts) do`, but I get the same error.
Finally, I have also played with the modify_algorithms - as mentioned on the home page, but I always get the public key, but always the same error:
{:modify_algorithms, [
prepend: [
public_key: [:"ssh-ed25519", :"ecdsa-sha2-nistp256"] # Try these first
],
append: [
public_key: [:"ssh-rsa"] # Try this as a last resort
]
]}
Can you give me a some help implementing private keys for multiple users against multiple sftp servers? Thanks,
Bill