train
train copied to clipboard
Better error on failed connection
Description
Attempting to use InSpec with an invalid/incorrect SSH key:
root@ip-172-31-13-75:/home/admin# /hab/pkgs/chef/inspec/3.2.6/20181220221744/bin/inspec detect -t ssh://18.188.240.220 --user ubuntu -i /root/.ssh/id_rsa
verify_host_key: false is deprecated, use :never
────────────────────────────── Platform Details ──────────────────────────────
Name: ubuntu
Families: debian, linux, unix, os
Release: 18.04
Arch: x86_64
root@ip-172-31-13-75:/home/admin# cat /root/.ssh/id_rsa
root@ip-172-31-13-75:/home/admin# /hab/pkgs/chef/inspec/3.2.6/20181220221744/bin/inspec detect -t ssh://18.188.240.220 --user ubuntu -i /root/.ssh/id_rsa.pub
verify_host_key: false is deprecated, use :never
verify_host_key: false is deprecated, use :never
verify_host_key: false is deprecated, use :never
verify_host_key: false is deprecated, use :never
verify_host_key: false is deprecated, use :never
Transport error, can't connect to 'ssh' backend: SSH session could not be established
We should post a better error when authentication fails.
Train and Platform Version
Inspec 3.26
Replication Case
Commands mentioned above.
Possible Solutions
We should post a better error when authentication fails. I was initially thinking my plumbing was broken.
Something like "Incorrect credentials" instead of "Transport error" might be more useful.
Yup, in this case it is a transport error in the context of Train. We could have a message like:
Transport error, can't connect to 'ssh' backend: Authentication failed