Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

So I'm installing Chef for the first time on an EC2 instance using the quick start guide and I have hit a wall at the point where I have to add a node so that running "sudo chef-client" does not give me a "401" error.

Here are the steps I've followed

sudo gem sources -a
sudo gem install ohai chef json

sudo apt-get install couchdb

sudo /etc/init.d/couchdb start
sudo /etc/init.d/couchdb status

sudo gem install chef-server chef-server-slice
sudo gem install stompserver

stompserver &

sudo vi /etc/chef/server.rb
sudo chef-indexer
sudo chef-server -c2 -N

git clone git://
cd chef-repo
vi config/rake.rb
rake test
git ci -am 'Add everything'
rake install

sudo chef-client

I have read through the managing nodes page but the documentation does not give me enough information to set myself up -- I have tried adding a registration token, but specifying it in /etc/chef/server.rb does not seem to change anything, and neither does sudo chef-client -t 'token'

I cannot use a web browser on this instance (tried lynx, it doesn't seem sufficient), so anything I do has to be doable through command line. Help?


locked by Chris S Mar 5 '12 at 3:04

This question exists because it has historical significance, but it is not considered a good, on-topic question for this site, so please do not use it as evidence that you can ask similar questions here. This question and its answers are frozen and cannot be changed. More info: help center.

closed as too localized by Chris S Mar 5 '12 at 3:04

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

If you are just getting started with chef you might want to skip ahead to chef 0.8, which is due to be released Real Soon Now. The upcoming version introduces a new key validation scheme that renders this bit of madness you're encountering obsolete.


So you have to delete the pending registration for this client (which you can't do from the command line, so an SSH tunnel is pretty much your only option) and then you can do this:

echo "{ \"run_list\": [ ] }"  > nothing.json
sudo chef-client -j nothing.json -t `cat /etc/chef/validation_token`

and try to use "sudo -E chef-client"...


The installation guide for Chef is here:

It has links for how to install a Chef Server, how to install Chef on client nodes or Chef Solo, and how to use Opscode's Hosted Chef as a Chef Server.

The steps outlined in the original question reflect a much older version of Chef.


Not the answer you're looking for? Browse other questions tagged or ask your own question.