Bootstrapping a client node

Hi Experts,

I was trying to bootstrap a client node from the chef work station. But it gives me this error:

[ec2-user@ip-172-31-49-26 ~] sudo knife bootstrap X.X.X.X -x ec2-user -i b.pem --sudo -N Client WARNING: No knife configuration file found WARN: Failed to read the private key /etc/chef/client.pem: #<Errno::ENOENT: No such file or directory @ rb_sysopen - /etc/chef/client.pem> ERROR: Your private key could not be loaded from /etc/chef/client.pem Check your configuration file and ensure that your private key is readable [ec2-user@ip-172-31-49-26 ~]

[ec2-user@ip-172-31-49-26 etc] pwd /etc [ec2-user@ip-172-31-49-26 etc] ls chef
ls: cannot access chef: No such file or directory
[ec2-user@ip-172-31-49-26 etc]$

Can you please help me to solve this problem? Which private key I have to copy to /etc/chef/client.pem?


I fixed it by running that command from the chef-repo folder.

[ec2-user@ip-172-31-49-26 ~] cd chef-repo/ [ec2-user@ip-172-31-49-26 chef-repo] sudo knife bootstrap x.x.x.x -x ec2-user -i b.pem --sudo -N Client
Node Client exists, overwrite it? (Y/N) Y
Client Client exists, overwrite it? (Y/N) Y

So when I run that command from inside the chef-repo folder it uses the pem files inside the .chef folder