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

To set a default user for each ssh connection, I would normally adjust my .ssh/config file to

Host *
User joe

Host *
User mike

I am now using Chef. The knife tool does not read from .ssh/config. So how can I set default usernames based on host?

One solution I do NOT want is to create a default "chef" user with full admin rights on every server and then use that user for batch server processes. There are many reasons I am hoping for a more optimal answer.

share|improve this question

So this feature doesn't exist yet in Chef - I'd encourage you to upvote and watch the ticket over here:

Potentially, you could grab the code change, and use it as a knife plugin, but that might be a little more monkeypatching code you'd want to do. :)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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