Capistrano的不受支持的密钥类型(Capistrano unsupported key ty

2019-10-19 10:17发布

当我做“帽生产部署”与Capistrano的CentOS上,我得到以下错误。

我敢肯定的是,我的两个Git和服务器pirvate键都完美的原始文件,以及公开密钥通常是在服务器上。

我有ssh_options [:键] = [File.join(ENV [ “HOME”] “的.ssh”, “例如,RSA”)在我production.rb,我把该文件作为/root/.ssh /例如-RSA正确。 我ssh-附加代管我对Git和服务器私钥。

奇怪的是,即使这两个文件需要口令短语,我的终端问我的密码混帐,但不是一个服务器

我同步我的红宝石版本与服务器,opeenssh,等等。

  triggering start callbacks for `deploy'
  * 2014-02-27 10:09:45 executing `multistage:ensure'
  * 2014-02-27 10:09:45 executing `deploy'
  * 2014-02-27 10:09:45 executing `deploy:update'
 ** transaction: start
  * 2014-02-27 10:09:45 executing `deploy:update_code'
    updating the cached checkout on all servers
    executing locally: "git ls-remote git@github.com:example/AskOnStack.git HEAD"
*** [deploy:update_code] rolling back
  * executing "rm -rf /home/deployer/apps/AskOnStack/releases/20140227010945; true"
    servers: ["**.**.***.**"]
 ** [deploy:update_code] exception while rolling back: Capistrano::ConnectionError, connection failed for: **.**.***.**:**** 

(NotImplementedError: unsupported key type `��"�ep���ˎ��-�wƿ3�����-���S�(�')
// this part is the start of errors. what are those strange texts?

/home/stackoverflow/.rvm/gems/ruby-1.9.3-p392-railsexpress/gems/capistrano-2.15.5/lib/capistrano/recipes/deploy.rb:138:in ``': No such file or directory - git ls-remote git@github.com:mocoga/KakaoGameFriend.git HEAD (Errno::ENOENT)
 from /home/stackoverflow/.rvm/gems/ruby-1.9.3-p392-railsexpress/gems/capistrano- 2.15.5/lib/capistrano/recipes/deploy.rb:138:in `block in run_locally'
 from /home/stackoverflow/.rvm/rubies/ruby-1.9.3-p392-railsexpress/lib/ruby/1.9.1/benchmark.rb:295:in `realtime'
    from /home/stackoverflow/.rvm/gems/ruby-1.9.3-p392-railsexpress/gems/capistrano-2.15.5/lib/capistrano/recipes/deploy.rb:137:in `run_locally'
    from /home/stackoverflow/.rvm/gems/ruby-1.9.3-p392-railsexpress/gems/capistrano-2.15.5/lib/capistrano/recipes/deploy.rb:43:in `block (3 levels) in load'
    from /home/stackoverflow/.rvm/gems/ruby-1.9.3-p392-railsexpress/gems/capistrano-2.15.5/lib/capistrano/recipes/deploy.rb:124:in `with_env'
    from /home/stackoverflow/.rvm/gems/ruby-1.9.3-p392-railsexpress/gems/capistrano-2.15.5/lib/capistrano/recipes/deploy.rb:43:in `block (2 levels) in load'
from /home/stackoverflow/.rvm/gems/ruby-1.9.3-p392-railsexpress/gems/capistrano-2.15.5/lib/capistrano/recipes/deploy/scm/git.rb:229:in `query_revision'
from /home/stackoverflow/.rvm/gems/ruby-1.9.3-p392-railsexpress/gems/capistrano-2.15.5/lib/capistrano/recipes/deploy/scm/base.rb:35:in `block in method_missing'
from /home/stackoverflow/.rvm/gems/ruby-1.9.3-p392-railsexpress/gems/capistrano-2.15.5/lib/capistrano/recipes/deploy/scm/base.rb:63:in `local'
from /home/stackoverflow/.rvm/gems/ruby-1.9.3-p392-railsexpress/gems/capistrano-2.15.5/lib/capistrano/recipes/deploy/scm/base.rb:35:in `method_missing'
from /home/stackoverflow/.rvm/gems/ruby-1.9.3-p392-railsexpress/gems/capistrano-2.15.5/lib/capistrano/recipes/deploy.rb:43:in `block in load'
from /home/stackoverflow/.rvm/gems/ruby-1.9.3-p392-railsexpress/gems/capistrano-2.15.5/lib/capistrano/configuration/variables.rb:87:in `call'
from /home/stackoverflow/.rvm/gems/ruby-1.9.3-p392-railsexpress/gems/capistrano-2.15.5/lib/capistrano/configuration/variables.rb:87:in `block in fetch'
from /home/stackoverflow/.rvm/gems/ruby-1.9.3-p392-railsexpress/gems/capistrano-2.15.5/lib/capistrano/configuration/variables.rb:110:in `block in protect'
from <internal:prelude>:10:in `synchronize'
from /home/stackoverflow/.rvm/gems/ruby-1.9.3-p392-railsexpress/gems/capistrano-2.15.5/lib/capistrano/configuration/variables.rb:110:in `protect'
from /home/stackoverflow/.rvm/gems/ruby-1.9.3-p392-railsexpress/gems/capistrano-2.15.5/lib/capistrano/configuration/variables.rb:78:in `fetch'
from /home/stackoverflow/.rvm/gems/ruby-1.9.3-p392-railsexpress/gems/capistrano-2.15.5/lib/capistrano/configuration/variables.rb:95:in `[]'
from /home/stackoverflow/.rvm/gems/ruby-1.9.3-p392-railsexpress/gems/capistrano-2.15.5/lib/capistrano/recipes/deploy/strategy/base.rb:86:in `revision'
from /home/stackoverflow/.rvm/gems/ruby-1.9.3-p392-railsexpress/gems/capistrano-2.15.5/lib/capistrano/recipes/deploy/strategy/remote_cache.rb:35:in `update_repository_cache'
from /home/stackoverflow/.rvm/gems/ruby-1.9.3-p392-railsexpress/gems/capistrano-2.15.5/lib/capistrano/recipes/deploy/strategy/remote_cache.rb:15:in `deploy!'
from /home/stackoverflow/.rvm/gems/ruby-1.9.3-p392-railsexpress/gems/capistrano-2.15.5/lib/capistrano/recipes/deploy.rb:253:in `block (2 levels) in load'
from /home/stackoverflow/.rvm/gems/ruby-1.9.3-p392-railsexpress/gems/capistrano-2.15.5/lib/capistrano/configuration/execution.rb:138:in `instance_eval'
from /home/stackoverflow/.rvm/gems/ruby-1.9.3-p392-railsexpress/gems/capistrano-2.15.5/lib/capistrano/configuration/execution.rb:138:in `invoke_task_directly'
from /home/stackoverflow/.rvm/gems/ruby-1.9.3-p392-railsexpress/gems/capistrano-2.15.5/lib/capistrano/configuration/callbacks.rb:25:in `invoke_task_directly_with_callbacks'
from /home/stackoverflow/.rvm/gems/ruby-1.9.3-p392-railsexpress/gems/capistrano-2.15.5/lib/capistrano/configuration/execution.rb:89:in `execute_task'
from /home/stackoverflow/.rvm/gems/ruby-1.9.3-p392-railsexpress/gems/capistrano-2.15.5/lib/capistrano/configuration/namespaces.rb:191:in `method_missing'
from /home/stackoverflow/.rvm/gems/ruby-1.9.3-p392-railsexpress/gems/capistrano-2.15.5/lib/capistrano/configuration/namespaces.rb:110:in `block in define_task'
from /home/stackoverflow/.rvm/gems/ruby-1.9.3-p392-railsexpress/gems/capistrano-2.15.5/lib/capistrano/recipes/deploy.rb:234:in `block (3 levels) in load'
from /home/stackoverflow/.rvm/gems/ruby-1.9.3-p392-railsexpress/gems/capistrano-2.15.5/lib/capistrano/configuration/execution.rb:56:in `transaction'
from /home/stackoverflow/.rvm/gems/ruby-1.9.3-p392-railsexpress/gems/capistrano-2.15.5/lib/capistrano/configuration/namespaces.rb:191:in `method_missing'
from /home/stackoverflow/.rvm/gems/ruby-1.9.3-p392-railsexpress/gems/capistrano-2.15.5/lib/capistrano/recipes/deploy.rb:233:in `block (2 levels) in load'
from /home/stackoverflow/.rvm/gems/ruby-1.9.3-p392-railsexpress/gems/capistrano-2.15.5/lib/capistrano/configuration/execution.rb:138:in `instance_eval'
from /home/stackoverflow/.rvm/gems/ruby-1.9.3-p392-railsexpress/gems/capistrano-2.15.5/lib/capistrano/configuration/execution.rb:138:in `invoke_task_directly'
from /home/stackoverflow/.rvm/gems/ruby-1.9.3-p392-railsexpress/gems/capistrano-2.15.5/lib/capistrano/configuration/callbacks.rb:25:in `invoke_task_directly_with_callbacks'
from /home/stackoverflow/.rvm/gems/ruby-1.9.3-p392-railsexpress/gems/capistrano-2.15.5/lib/capistrano/configuration/execution.rb:89:in `execute_task'
from /home/stackoverflow/.rvm/gems/ruby-1.9.3-p392-railsexpress/gems/capistrano-2.15.5/lib/capistrano/configuration/namespaces.rb:191:in `method_missing'
from /home/stackoverflow/.rvm/gems/ruby-1.9.3-p392-railsexpress/gems/capistrano-2.15.5/lib/capistrano/configuration/namespaces.rb:110:in `block in define_task'
from /home/stackoverflow/.rvm/gems/ruby-1.9.3-p392-railsexpress/gems/capistrano-2.15.5/lib/capistrano/recipes/deploy.rb:201:in `block (2 levels) in load'
from /home/stackoverflow/.rvm/gems/ruby-1.9.3-p392-railsexpress/gems/capistrano-2.15.5/lib/capistrano/configuration/execution.rb:138:in `instance_eval'
from /home/stackoverflow/.rvm/gems/ruby-1.9.3-p392-railsexpress/gems/capistrano-2.15.5/lib/capistrano/configuration/execution.rb:138:in `invoke_task_directly'
from /home/stackoverflow/.rvm/gems/ruby-1.9.3-p392-railsexpress/gems/capistrano-2.15.5/lib/capistrano/configuration/callbacks.rb:25:in `invoke_task_directly_with_callbacks'
from /home/stackoverflow/.rvm/gems/ruby-1.9.3-p392-railsexpress/gems/capistrano-2.15.5/lib/capistrano/configuration/execution.rb:89:in `execute_task'
from /home/stackoverflow/.rvm/gems/ruby-1.9.3-p392-railsexpress/gems/capistrano-2.15.5/lib/capistrano/configuration/execution.rb:101:in `find_and_execute_task'
from /home/stackoverflow/.rvm/gems/ruby-1.9.3-p392-railsexpress/gems/capistrano-2.15.5/lib/capistrano/cli/execute.rb:46:in `block in execute_requested_actions'
from /home/stackoverflow/.rvm/gems/ruby-1.9.3-p392-railsexpress/gems/capistrano-2.15.5/lib/capistrano/cli/execute.rb:45:in `each'
from /home/stackoverflow/.rvm/gems/ruby-1.9.3-p392-railsexpress/gems/capistrano-2.15.5/lib/capistrano/cli/execute.rb:45:in `execute_requested_actions'
from /home/stackoverflow/.rvm/gems/ruby-1.9.3-p392-railsexpress/gems/capistrano-2.15.5/lib/capistrano/cli/help.rb:19:in `execute_requested_actions_with_help'
from /home/stackoverflow/.rvm/gems/ruby-1.9.3-p392-railsexpress/gems/capistrano-2.15.5/lib/capistrano/cli/execute.rb:34:in `execute!'
from /home/stackoverflow/.rvm/gems/ruby-1.9.3-p392-railsexpress/gems/capistrano-2.15.5/lib/capistrano/cli/execute.rb:14:in `execute'
from /home/stackoverflow/.rvm/gems/ruby-1.9.3-p392-railsexpress/gems/capistrano-2.15.5/bin/cap:4:in `<top (required)>'
from /home/stackoverflow/.rvm/gems/ruby-1.9.3-p392-railsexpress/bin/cap:23:in `load'
from /home/stackoverflow/.rvm/gems/ruby-1.9.3-p392-railsexpress/bin/cap:23:in `<main>'
from /home/stackoverflow/.rvm/gems/ruby-1.9.3-p392-railsexpress/bin/ruby_executable_hooks:15:in `eval'
from /home/stackoverflow/.rvm/gems/ruby-1.9.3-p392-railsexpress/bin/ruby_executable_hooks:15:in `<main>'

Answer 1:

我的问题是我有很多不同的钥匙在我的本地~/.ssh/known_hosts文件,因为每一个我的虚拟主机重新启动应急模式时它会改变。

所以我删除了所有的人,并连接到SSH正常(不通过Capistrano的)之后,我试着用Capistrano的,它的工作。

其他细节:这发生在SSH有无法读取密钥文件,你可以运行ssh -v user@host ,看看这是怎么回事

(见第一个答案的评论在这里: https://serverfault.com/questions/613756/how-to-stop-ssh-passphrase-prompt )



Answer 2:

通过删除解决newline后焦炭ssh-rsa在我的$HOME/.ssh/id_rsa.pub

如果您使用的是不同的公共密钥文件改变这种状况。



Answer 3:

在我来说,我是越来越

cap aborted!
Z?.?.D??'entedError: unsupported key type `??c=M?#HF?:??

当我试图重新启动puma我的prod与Capistrano的服务器:

bundle exec cap production puma:restart --trace

这是一个非常奇怪的问题,我花了好几分钟找到什么样的交易...我想检查哪些文件是失败, capistrano运行规律ssh命令,我非常确信我可以ssh服务器就好了,我确诊: ssh -v -i my_key.pem ec2-user@6.66.666.666是我能做到这一点。

一切似乎像net-ssh不解析文件中的一个在我的情况,我这是怎么找到多少文件,并且可以使用哪些。

附: ls ~/.ssh我看到所有这些my_key.pem config id_rsa id_rsa.pub known_hosts

我不得不通过一对一的重命名每个文件,找到这将导致不同的错误,我做了,直到我发现这个其他错误信息:

cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as
....
Authentication failed for user
....

**这是known_hosts **文件! 因为是自动生成这个文件我刚刚创建的备份( mv ~/.ssh/known_hosts ~/.ssh/known_hosts.BAK ),并继续前行! :)能终于重新开始我的督促的服务器PUMA过程,这使得Web应用程序就像是之前的工作(有AWS EC2实例的问题,所以不得不重启盒子)



文章来源: Capistrano unsupported key type