Description
Hi, when I start chef-run I got error messages that my ssh config file isn't setup correctly. I have a ssh config file in my home folder which one is working if I use build-in ssh - it will connect to the definied server and ask for the definied key within my config file:
PS C:\Users\chg> ssh mailsrv
Enter passphrase for key '.\.ssh\id_rsa':
...
But it is not working if I use chef-run:
PS C:\Users\chg\Documents\chef-repo\cookbooks\debian10_sec\recipes> chef-run mailsrv default.rb
[✔] Packaging cookbook... done!
[✔] Generating local policyfile... exporting... done!
[✖] Applying debian10_sec::default from C:/Users/chg/Documents/chef-repo/cookbooks/debian10_sec to target. |__ [✖] [mailsrv] No authentication methods available.
No authentication methods available.
Try...
- Provide a password with "--password PASSWORD"
- Provide a key with "-identity-file PATH/TO/FILE"
- Enable ssh-agent and add keys
- Add a host entry to your ssh configuration
Additional instructions can be found in the troubleshooting documentation:
https://www.chef.sh/docs/chef-workstation/troubleshooting/#error-code-cheftrn007
Where do chef-run search for the config file?
Chef Workstation Version
Chef Workstation version: 0.11.21
Chef Infra Client version: 15.4.45
Chef InSpec version: 4.18.0
Chef CLI version: 2.0.0
Test Kitchen version: 2.3.4
Cookstyle version: 5.10.13
chef-run: 0.4.6
Platform Version
Windows 10 Pro (1909)
stack-trace:
--------------------------------------------------------------------------------
2019-11-25 16:24:24 +0100: Error encountered while running the following:
mailsrv default.rb
Backtrace:
ChefApply::TargetHost::ConnectionFailure: ChefApply::TargetHost::ConnectionFailure
C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.6.0/gems/chef-apply-0.4.6/lib/chef_apply/target_host.rb:131:in `rescue in connect!'
C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.6.0/gems/chef-apply-0.4.6/lib/chef_apply/target_host.rb:114:in `connect!'
C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.6.0/gems/chef-apply-0.4.6/lib/chef_apply/cli.rb:334:in `do_connect'
C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.6.0/gems/chef-apply-0.4.6/lib/chef_apply/cli.rb:180:in `connect_target'
C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.6.0/gems/chef-apply-0.4.6/lib/chef_apply/cli.rb:165:in `block (2 levels) in render_converge'
C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.6.0/gems/chef-apply-0.4.6/lib/chef_apply/ui/terminal/job.rb:31:in `run'
C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.6.0/gems/chef-apply-0.4.6/lib/chef_apply/ui/terminal.rb:60:in `block (2 levels) in render_parallel_jobs'
C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.6.0/gems/tty-spinner-0.9.1/lib/tty/spinner.rb:225:in `execute_job'
C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.6.0/gems/tty-spinner-0.9.1/lib/tty/spinner/multi.rb:150:in `block (2 levels) in auto_spin'
Caused by: Train::ClientError: Your SSH Agent has no keys added, and you have not specified a password or a key file
C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.6.0/gems/train-core-3.1.4/lib/train/transports/ssh.rb:106:in `validate_options'
C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.6.0/gems/train-core-3.1.4/lib/train/transports/ssh.rb:76:in `connection'
C:/opscode/chef-workstation/embedded/lib/ruby/gems/2.6.0/gems/chef-apply-0.4.6/lib/chef_apply/target_host.rb:118:in `connect!'
... 7 more
Description
Hi, when I start chef-run I got error messages that my ssh config file isn't setup correctly. I have a ssh config file in my home folder which one is working if I use build-in ssh - it will connect to the definied server and ask for the definied key within my config file:
But it is not working if I use chef-run:
Where do chef-run search for the config file?
Chef Workstation Version
Chef Workstation version: 0.11.21
Chef Infra Client version: 15.4.45
Chef InSpec version: 4.18.0
Chef CLI version: 2.0.0
Test Kitchen version: 2.3.4
Cookstyle version: 5.10.13
chef-run: 0.4.6
Platform Version
Windows 10 Pro (1909)
stack-trace: