chef / chef/chef

Knife bootstrap identity file is not picking up

Open
#13,485 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Status: Untriaged
Dominant language
Ruby
Stars
8.2k
Forks
2.5k
Avg merge
4d 5h
Merged PRs (30d)
23

Description

I am able to ssh to server with same key, but knife command is not using identity file but asking for password.

Tried on windows-11 and ubuntu 22.04

knife bootstrap ip -p 22 -U ubuntu --sudo -i test.pem -N test --bootstrap-version 18.1.0 -VV

WARNING: No knife configuration file found. See https://docs.chef.io/config_rb/ for details.
DEBUG: Checking if we need to accept Chef license to bootstrap node
DEBUG: Reading products and relationships...
DEBUG: Successfully read products and relationships
DEBUG: License acceptance required for chef version: 18.1.0
DEBUG: Searching for the following licenses: ["infra-client", "inspec"]
DEBUG: Found license chef_infra_client at /home/ubuntu/.chef/accepted_licenses/chef_infra_client
DEBUG: Found license inspec at /home/ubuntu/.chef/accepted_licenses/inspec
DEBUG: Missing licenses remaining: []
DEBUG: All licenses present
Connecting to 15.206.203.164 using ssh
DEBUG: [SSH] opening connection to ubuntu@15.206.203.164
DEBUG: [SSH] using options {:user_known_hosts_file=>"/dev/null", :port=>"22", :compression=>false, :compression_level=>0, :keepalive=>true, :keepalive_interval=>60, :timeout=>60, :auth_methods=>["none", "publickey"], :keys_only=>true, :keys=>["vikrant.pem"], :password=>"", :forward_agent=>false, :non_interactive=>true, :append_all_supported_algorithms=>true, :verify_host_key=>:always}
The authenticity of host '[15.206.203.164]:22 ()' can't be established.
fingerprint is SHA256:2CV1pe0kHqdp7OXC3gf6WUJxJNPOKC1IgNlumGasDbM.

Are you sure you want to continue connecting
? (Y/N) Y
Connecting to 15.206.203.164 using ssh
DEBUG: [SSH] opening connection to ubuntu@15.206.203.164
DEBUG: [SSH] using options {:user_known_hosts_file=>"/dev/null", :port=>"22", :compression=>false, :compression_level=>0, :keepalive=>true, :keepalive_interval=>60, :timeout=>60, :auth_methods=>["none", "publickey"], :keys_only=>true, :keys=>["vikrant.pem"], :password=>"", :forward_agent=>false, :non_interactive=>true, :append_all_supported_algorithms=>true, :verify_host_key=>:accept_new}
INFO: [SSH] connection failed, retrying in 1 seconds (#<Net::SSH::AuthenticationFailed: Authentication failed for user ubuntu@15.206.203.164>)
DEBUG: [SSH] opening connection to ubuntu@15.206.203.164
DEBUG: [SSH] using options {:user_known_hosts_file=>"/dev/null", :port=>"22", :compression=>false, :compression_level=>0, :keepalive=>true, :keepalive_interval=>60, :timeout=>60, :auth_methods=>["none", "publickey"], :keys_only=>true, :keys=>["vikrant.pem"], :password=>"", :forward_agent=>false, :non_interactive=>true, :append_all_supported_algorithms=>true, :verify_host_key=>:accept_new}
INFO: [SSH] connection failed, retrying in 1 seconds (#<Net::SSH::AuthenticationFailed: Authentication failed for user ubuntu@15.206.203.164>)
DEBUG: [SSH] opening connection to ubuntu@15.206.203.164
DEBUG: [SSH] using options {:user_known_hosts_file=>"/dev/null", :port=>"22", :compression=>false, :compression_level=>0, :keepalive=>true, :keepalive_interval=>60, :timeout=>60, :auth_methods=>["none", "publickey"], :keys_only=>true, :keys=>["vikrant.pem"], :password=>"", :forward_agent=>false, :non_interactive=>true, :append_all_supported_algorithms=>true, :verify_host_key=>:accept_new}
INFO: [SSH] connection failed, retrying in 1 seconds (#<Net::SSH::AuthenticationFailed: Authentication failed for user ubuntu@15.206.203.164>)
DEBUG: [SSH] opening connection to ubuntu@15.206.203.164
DEBUG: [SSH] using options {:user_known_hosts_file=>"/dev/null", :port=>"22", :compression=>false, :compression_level=>0, :keepalive=>true, :keepalive_interval=>60, :timeout=>60, :auth_methods=>["none", "publickey"], :keys_only=>true, :keys=>["vikrant.pem"], :password=>"", :forward_agent=>false, :non_interactive=>true, :append_all_supported_algorithms=>true, :verify_host_key=>:accept_new}
INFO: [SSH] connection failed, retrying in 1 seconds (#<Net::SSH::AuthenticationFailed: Authentication failed for user ubuntu@15.206.203.164>)
DEBUG: [SSH] opening connection to ubuntu@15.206.203.164
DEBUG: [SSH] using options {:user_known_hosts_file=>"/dev/null", :port=>"22", :compression=>false, :compression_level=>0, :keepalive=>true, :keepalive_interval=>60, :timeout=>60, :auth_methods=>["none", "publickey"], :keys_only=>true, :keys=>["vikrant.pem"], :password=>"", :forward_agent=>false, :non_interactive=>true, :append_all_supported_algorithms=>true, :verify_host_key=>:accept_new}
WARN: [SSH] connection failed, terminating (#<Net::SSH::AuthenticationFailed: Authentication failed for user ubuntu@15.206.203.164>)
WARNING: Failed to authenticate ubuntu to 15.206.203.164 - trying password auth
Enter password for ubuntu@15.206.203.164:

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the shown knife bootstrap command with -i test.pem and -VV, then inspect the knife bootstrap SSH option handling reflected in the debug output. Verify that the supplied identity file is used for public-key authentication and that a password prompt is not triggered when the key is valid.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
cli, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.