Skip to content

Error loading key with ssh command #213

@arty-hlr

Description

@arty-hlr

Hi,

I am trying to make vault-cli ssh work, and unfortunately it does not want to load the private key:

vault-cli ssh --key kv/<REDACTED>:PRIV_KEY --passphrase kv/<REDACTED>:PASSPHRASE -- ssh <USER>@<IP>
Error: VaultSubprocessException: Error loading key "(stdin)": error in libcrypto
CalledProcessError: Command '['ssh-add', '-']' returned non-zero exit status 1.

whereas if I try to add the key manually, like https://github.com/peopledoc/vault-cli/blob/master/vault_cli/ssh.py#L48:

vault-cli get kv/<REDACTED> PRIV_KEY | ssh-add -
Enter passphrase for (stdin): <REDACTED_PASSPHRASE>
Identity added: (stdin) (<USER>@<IP>)

I am not sure what the issue could be as the private key is valid and correctly stored in vault with a kv1 engine.

Can you maybe have a look and see if you can reproduce it? :) Let me know if you need any more informations from my side.

Best

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions