Configuring the pem file to use for chef push


I have a root user trying to use chef push command. I’m getting the error that it can’t find /root/.chef/ourkey.pem. The pem file already exists in /etc/chef. Root user does not have a .chef directory. Why is it trying to load from a home directory? My client.rb in /etc/chef is as follows:

chef_server_url        ""
validation_client_name "our-validator"
validation_key         "/etc/chef/our-validator.pem"
ssl_verify_mode        :verify_none
policy_group           "ourcookbooks"
policy_name            "ourcookbooks"


WARN: Failed to read the private key /root/.chef/ourkey.pem: #<Errno::ENOENT: No such file or directory @ rb_sysopen - /root/.chef/ourkey.pem>

Where do I specify to not look in home directory and to check /etc/chef?

Hi. The chef-client and the knife configuration are two different things. For push jobs you need to configure knife just like you did on your workstation ( Of course you can point that configuration then to your /etc/chef/client.pem.