Chef inspec authetication error

Hi,

I created a rb file using the chef inspec where my automate server is installed. I am able to exec the file in the same machine successfully but when it is run on a client node it gives authentication error even though the ports are open.

inspec exec admin/mytest.rb -t ssh://user@127.0.0.1 -i key

I, [2017-12-20T16:19:05.288449 #24823] INFO – : [SSH] connection failed, retrying in 1 seconds (#<Net::SSH::AuthenticationFailed: Authentication failed for user user@127.0.0.1>)

replace user with actual username and specify full key path!!

for ex: for vagrant

inspec exec admin/mytest.rb -t ssh://vagrant@127.0.0.1 -i path/to/private_key

you can get full private_key path with vagrant ssh-config