Making knife ssh work with chef 0.10

Different version, different behaviour

A while ago we updated Chef to the current release. It had some fixes we needed and no one likes to use old smelly software versions, right?

One thing we ran into is that the current version of knife ssh doesn’t read ssh configuration from ~/.ssh/config any more. Like a lot of people we use a non-standard SSH port and have dedicated SSH keys, so this was a huge pain. You can specify the ssh port with -p and the identity file with -i, but using those all the time makes the command line ugly.

Not very well documented configuration

A bunch of searching this morning led me to the solution: you can specify these options in knife.rb, it’s just not documented anywhere but a JIRA ticket. To help signal boost this bit of hidden knowledge, here’s the lines I added to my ~/.chef/knife.rb to make knife ssh tolerable again:

knife[:identity_file] = '/Users/john/.ssh/picklive_identity_file'
knife[:ssh_port] = 1234

(Details changed from actual values, of course.)

Posted on 15 November 2011 by John @semanticist.
blog comments powered by Disqus