Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inspec exec doesn't work with ssh when ran from Ansible tower. #581

Open
pbandari2701 opened this issue Mar 27, 2020 · 0 comments
Open

inspec exec doesn't work with ssh when ran from Ansible tower. #581

pbandari2701 opened this issue Mar 27, 2020 · 0 comments

Comments

@pbandari2701
Copy link

Issue: Inspec ssh is unable to connect to a remote instance from Ansible tower. A general ssh is working as expected but when we try to connect with inspec ssh, we are unable to authenticate, or connection timed out is received.

Tried below options to run inspec ssh.

  1. Invoked inspec ssh train using below command by passing key available key files in Ansible tower. – Failed
    Inspec exec test.profile - -backend ssh - -host hostmachine - -user username - - key-files ~/.ssh/id_rsa

  2. Generated a ssh key via ssh-keygen and passed the generated key files to inspec train .
    Normal ssh i.e: ssh user@host -i ~/.ssh/id_rsa worked as expected, and able to connect to host. - Passed
    SSH via inspec train failed e.g : inspec exec -t ssh://user@host -i ~/.ssh/id_rsa – Failed

  3. Used ssh-add to add keys to the SSH Client on the Ansible tower machine and tried to connect via inspec ssh train – Failed.

Failed with below error.

I, INFO -- : [SSH] connection failed, retrying in 1 seconds (#<Net::SSH::AuthenticationFailed: Authentication failed for user user_name@hostname)
I, INFO -- : [SSH] connection failed, retrying in 1 seconds (#<Net::SSH::AuthenticationFailed: Authentication failed for user user_name@hostname)
I, INFO -- : [SSH] connection failed, retrying in 1 seconds (#<Net::SSH::AuthenticationFailed: Authentication failed for useruser_name@hostname)
I, INFO -- : [SSH] connection failed, retrying in 1 seconds (#<Net::SSH::AuthenticationFailed: Authentication failed for user user_name@hostname)
W, WARN -- : [SSH] connection failed, terminating (#<Net::SSH::AuthenticationFailed: Authentication failed for user user_name@hostname)
Transport error, can't connect to 'ssh' backend: SSH session could not be established

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant