ever get an error like this?


/sw/lib/ruby/gems/1.8/gems/net-ssh-1.1.1/lib/net/ssh/host-key-verifier.rb:47:in `process_cache_miss': fingerprint da:34:2e:a6:87:c4:c8:49:0e:a1:8e:39:fd:fc:ef:e7 does not match for threestonehearth.com (Net::SSH::HostKeyMismatch)
        from /sw/lib/ruby/gems/1.8/gems/net-ssh-1.1.1/lib/net/ssh/host-key-verifier.rb:38:in `verify'
        from /sw/lib/ruby/gems/1.8/gems/net-ssh-1.1.1/lib/net/ssh/lenient-host-key-verifier.rb:9:in `verify'
        from /sw/lib/ruby/gems/1.8/gems/net-ssh-1.1.1/lib/net/ssh/transport/kex/dh.rb:165:in `verify_server_key'
        from /sw/lib/ruby/gems/1.8/gems/net-ssh-1.1.1/lib/net/ssh/transport/kex/dh.rb:232:in `exchange_keys'
        from /sw/lib/ruby/gems/1.8/gems/needle-1.3.0/lib/needle/lifecycle/proxy.rb:60:in `__send__'
        from /sw/lib/ruby/gems/1.8/gems/needle-1.3.0/lib/needle/lifecycle/proxy.rb:60:in `method_missing'
        from /sw/lib/ruby/gems/1.8/gems/net-ssh-1.1.1/lib/net/ssh/transport/session.rb:182:in `exchange_keys'
        from /sw/lib/ruby/gems/1.8/gems/net-ssh-1.1.1/lib/net/ssh/transport/session.rb:143:in `kexinit'
         ... 49 levels...
        from /sw/lib/ruby/gems/1.8/gems/capistrano-1.99.1/lib/capistrano/cli/execute.rb:14:in `execute'
        from /sw/lib/ruby/gems/1.8/gems/capistrano-1.99.1/bin/cap:4
        from /sw/bin/cap:16:in `load'
        from /sw/bin/cap:16

Run this fix in irb.

require 'rubygems'
require 'net/ssh'
include Net

domain = '######' # insert IP address or domain name here

begin
  Net::SSH.start( domain ) do |ssh|
    # ...
  end
rescue Net::SSH::HostKeyMismatch => e
  puts "remembering new key: #{e.fingerprint}" 
  e.remember_host!
  retry
end

Based on a post by Jamis Buck

actionmailer ActionView ActiveRecord activesupport ajax alphadecimal audio autotest BDD blocks capistrano ssh ruby controller css dashboard widget delegate dog puppy naming name DRM email obfuscation exceptions factories-and-workers factory pattern filemerge find and replace finder fink fixtures fun functional testing gem git google maps haml helper helpers imagemagick Intertrust javascript jquery jrails logo math meetup model openssl OS X patch Pioneer Electronics plugin polymorphism prototype.js rails rails gotcha rails,patch,validations railsconf rake rmagick RSA encryption ruby script shoulda subversion SyncTV TDD testing textmate tips tricks unique hashes unix shell validation view yaml zebra stripes