Could not connect to ssh-agent

What I am missing while running knife bootstrap.

DEBUG: none failed
DEBUG: trying publickey
DEBUG: connecting to ssh-agent
ERROR: could not connect to ssh-agent
DEBUG: trying publickey (fc:30:8b:73:28:0a:f8:17:2e:f5:29:8c:3d:77:56:92)
DEBUG: queueing packet nr 6 type 50 len 348

So when you are using hosted chef you need to pass in a private key with the bootstrap and have the public key in your autherized_keys fileā€¦

  1. install the ChefSDK
  2. SCP your starter kit from hosted Chef
  3. extract the starter kit to ~/chef-repo
  4. generate a new keypair: ssh-keygen
  5. add the public key to your autherized_keys file: $ cat id_rsa.pub >> authorized_keys
  6. run the knife bootstrap with the following:

sudo knife bootstrap {{server-ip}} --ssh-user {{your-server-user}} -i ~/.ssh/id_rsa --sudo --node-name web1
That should work!

I would also suggest that the user you pass as the --ssh-user has passwordless sudo access