ansible-plugin icon indicating copy to clipboard operation
ansible-plugin copied to clipboard

ssh-add hangs with Bad passphrase, try again

Open mchubby opened this issue 2 years ago • 0 comments

Tested on v4.0.0 Debian 10 openjdk 11 openssh-client 7.9p1

When providing a wrong passphrase, the ssh-add says it's a Bad passphrase, try again for <path> and prompts again indefinitely (expects more stdin data).

As far as the plugin is concerned it does not expect this case, we see nothing of that in the logs. We have to either kill the job or wait for it to time out.

Relevant code is https://github.com/rundeck-plugins/ansible-plugin/blob/34e9ddeb9acdfd7ce8c55d48b562d9f110fe5e9a/src/main/groovy/com/rundeck/plugins/ansible/ansible/AnsibleRunner.java#L633-L650

but my Java is too rusty to provide a PR (sorry).

I suppose it should read stdout and look for the error message (pass LANG=C just in case). or use -p for later openssh versions (8.4 I think)

mchubby avatar Apr 06 '22 11:04 mchubby