Ssh – Chef: Knife ssh connection error

chefknifessh

I try to run a command on all my nodes but get the following error. The chef docs say it should work like this.

me$ sudo knife ssh "name:*" "uptime" -x myuser
WARNING: Failed to connect to  -- Errno::ECONNREFUSED: Connection refused - connect(2)
WARNING: Failed to connect to  -- SocketError: getaddrinfo: nodename nor servname provided, or not known

Best Answer

The knife-ssh plugin uses the ipaddress attribute on each node. You might like to check the value of this attribute on your nodes. If it's incorrect, nonexistent, or unreachable from where you are running knife, you will get connection errors like the above.