Open mchubby opened 1 year ago
Confirmed @mchubby Thanks for the detailed information to reproduce!
Related to #20
When passphrase is not in a storage path (i.e. secure option) getPrivateKeyPassphrase()
is no longer called
https://github.com/rundeck-plugins/sshj-plugin/blob/5ea2ded50a6b51af3f60089cd555353f4c8634ff/src/main/java/com/plugin/sshjplugin/model/SSHJAuthentication.java#L34-L47
vs.
https://github.com/rundeck-plugins/sshj-plugin/blob/7fc6c3e6e3eb7f60aeecaacdd123662d1f5b29fd/src/main/java/com/plugin/sshjplugin/model/SSHJAuthentication.java#L45-L50
Summary
Recently upgraded from 4.12 to 4.17, now SSH jobs fail. We were already using SSHJ jobs without issue. The private key is password-protected.
Details
service.log has this output for the relevant execution:
@MegaDrive68k can you please take a look?
Here is the test case:
/var/rundeck/gitroot/sshtest-nodes.yml
/var/rundeck/gitroot/sshtest-passphrased.key
sshtest project: only defines the .key path and nodes (SSHJ is now default in 4.17).
Job definition
000_diag_SingleCommand.yaml
Action: run job with debug output, providing the key passphrase.
Expected Results
Provided script commands are executed (see attached log output file Output986-SSHJv0.1.7.txt)
To obtain this execution result, default plugin v0.19 was uninstalled, then the v0.17 jar was installed serverwide.
Observed Results
Using SSH plugin v0.19, SSH connection fails, therefore the job does too.
Nodeside, OpenSSH logs a new (tcp) connection and that's it.
see attached log for full output Output988-SSHJv0.1.9.txt
Note: I tried setting -XX:MaxJavaStackTraceDepth=2000 in /etc/defaults/rundeckd but the exception stackdump is still incomplete.
Remarks
Using a non-password-protected key works. i.e.
ssh-keygen -p -f ...
ssh-key-passphrase-option
entry (optional)