Problem. Following command line

knife bootstrap 127.0.0.1 -r 'recipe[chef-client]' -x user -p password --sudo

returns

Bootstrapping Chef on 127.0.0.1
WARNING: Failed to connect to 127.0.0.1 -- Errno::ECONNREFUSED: Connection refused - connect(2)

Expected that this command will succeed and after it

knife node list

will return

[
"127.0.0.1"
]

SSH server is working fine on localhost and ssh user@127.0.0.1 -p password works as expected.

link|improve this question
feedback

migrated from stackoverflow.com May 6 '11 at 7:36

This question came from our site for professional and enthusiast programmers.

1 Answer

If you're getting a connection refused, then an SSH connection could not be opened because either:

  • SSH is not running on the system.
  • A firewall rule is blocking access to port 22.
  • SSH is running on a port other than 22.

That said, "knife bootstrap" is intended to be used to set up remote systems with Ruby/RubyGems, install Chef and configure it to connect to a configured chef server (from your local knife configuration). For more information about the "knife bootstrap" command, see:

Also, the node name will be the detected fully qualified domain name (typically output of hostname -f), unless specified with -N NODE_NAME.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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