Capistrano错误-Net::SSH::HostKeyMismatch

执行cap production deploy:setup报如下错误:

 * executing `production'
  * executing `deploy:setup'
  * executing "***"
    servers: ["***"]
connection failed for: *** (Net::SSH::HostKeyMismatch: fingerprint *** does not match for "***,***")

这是因为目标主机的物理网卡地址与IP地址不匹配或者是因为IP地址与原域名的IP映射不匹配。有两种解决方法,一是清空本机的~/.ssh/known_hosts文件:

> ~/.ssh/known_hosts
# 或
cat /dev/null > ~/.ssh/known_hosts

第二种方法则是配置ssh客户端(即本机的/etc/ssh_config文件),使其不检查known_hosts文件中的内容。当然也可以配置capistrano忽略known_hosts的验证:

ssh_options[:paranoid] = false

Monitor Your Web Site 24/7 - Receive email and SMS alerts anytime your web site goes down.

Related Posts

Leave a Reply

Monitor Your Web Site 24/7 - Receive email and SMS alerts anytime your web site goes down.

About Me

About Me
Record Technical Articles at Gooss.org.

Entries (RSS) and Comments (RSS). Valid XHTML and CSS and XFN.

© Copyright 2009 山海经. All rights reserved.

Social Bookmarks

Copyright © Designed by: Free WP Templates
Food Charts |  About Breast Milk |  Organic Food