Knife ssh -m Command doesn't allows to finish the password entry of first server and jumps into next server in the list

Hello all,

Chef Development Kit Version: 0.14.25
chef-client version: 12.10.24

I am trying to execute a knife ssh -m command something like this

knife ssh ‘recipe:CookbookName::RecipeName’ ‘chef-client’ --ssh-user XXXXXX --ssh-password XXXXXXX
knife ssh -m ‘server1 server2 server3’ ‘chef-client’ --ssh-user XXXXXX --ssh-password XXXXXXX

When I execute this command it is still asking for server 1 password and by the time I enter server 1 password it is asking for server 2 and server 3. It is not allowing me to enter the password completely. What might be the issue?

Thanks in advance.


It’s quite likely this is asking for the password for sudo. I’ve run into this issue at work where we use password auth for ssh and then need to use a password for sudo. Not sure if this is the best solution but what I’d do is enable passwordless-sudo for your user and use public key auth so that you don’t need to throw passwords around everywhere.



Hello Evan,

Thanks for your response. I can execute chef-client remotely using (ssh keys) for unix machines. But I am facing an issue when I wanted do same thing on windows servers. Could you please provide me details on how to execute chef-client remotely on windows servers.


For that you’ll want to use knife winrm, I believe. (I think there’s also another option, but winrm is the one I’m familiar with.) There have been some changes recently so you probably want the dev chefdk build that has the newer version of knife-windows. But with that you can specify your account as “-x domain\user”, leave the password blank, and it will prompt you for it. I haven’t used this against multiple machines, but if you have issues with that you can do “-x domain\user -P password”. On unix, people can see the password from the process list, but if you execute it from a Windows node or a non-shared system it should be fine.

Nathan Clemons
DevOps Engineer
Moxie Cloud Services (MCS)

O +1.425.467.5075
M +1.360.861.6291
W www.gomoxie.com