简体   繁体   English

Capistrano:用户 ubuntu@xx.xxx.xxx.xxx 的身份验证失败(Net::SSH::AuthenticationFailed)

[英]Capistrano: Authentication failed for user ubuntu@xx.xxx.xxx.xxx (Net::SSH::AuthenticationFailed)

I can connect via ssh ubuntu@xx.xxx.xxx.xxx .我可以通过ssh ubuntu@xx.xxx.xxx.xxx连接。 but not via cap production deploy:check但不是通过cap production deploy:check

current当前的

set :user, "ubuntu"
set :ssh_options, { forward_agent: true }

server "xx.xxx.xxx.xxx",
       user: fetch(:user),
       roles: %w[web app db]

tried试过了

set :user, "ubuntu"
set :ssh_options, {
  forward_agent: true,
  user: fetch(:user),
  keys: %w(~/.ssh/id_rsa)
}

server "xx.xxx.xxx.xxx",
       user: fetch(:user),
       roles: %w[web app db]

The "current" used to be my setup for other projects, and I just have to ssh-add then cap production deploy “当前”曾经是我为其他项目设置的,我只需要ssh-add然后cap production deploy

What changed?发生了什么变化? or is my config incorrect?还是我的配置不正确?

issue: Authentication failed for user ubuntu@xx.xxx.xxx.xxx (Net::SSH::AuthenticationFailed) via capistrano but can ssh directly问题:通过 capistrano 对用户 ubuntu@xx.xxx.xxx.xxx (Net::SSH::AuthenticationFailed) 进行身份验证失败,但可以直接 ssh

debugging:调试:

  • sudo tail -f /var/log/auth.log on the server sudo tail -f /var/log/auth.log在服务器上
  • then tried cap production deploy:check on my local然后尝试cap production deploy:check我的本地
  • userauth_pubkey: key type ssh-rsa not in PubkeyAcceptedAlgorithms [preauth] appeared from auth.log userauth_pubkey:来自auth.log userauth_pubkey: key type ssh-rsa not in PubkeyAcceptedAlgorithms [preauth]

solution:解决方案:

  • edited then /etc/ssh/sshd_config然后编辑/etc/ssh/sshd_config
    • find PubkeyAuthentication then uncomment(remove # )找到PubkeyAuthentication然后取消注释(删除#
    • add PubkeyAcceptedKeyTypes=+ssh-rsa添加PubkeyAcceptedKeyTypes=+ssh-rsa
  • restart sshd sudo systemctl restart sshd重启 sshd sudo systemctl restart sshd

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Capistrano 3.5 Net :: SSH :: AuthenticationFailed:验证失败 - Capistrano 3.5 Net::SSH::AuthenticationFailed: Authentication failed Net::SSH::AuthenticationFailed:用户身份验证失败 - Net::SSH::AuthenticationFailed: Authentication failed for user Capistrano无法部署代码,因为Net :: SSH :: AuthenticationFailed:验证失败 - Capistrano cannot deploy code, because Net::SSH::AuthenticationFailed: Authentication failed 重启服务器实例后,Capistrano 抛出 Authentication failed for user Net::SSH::AuthenticationFailed 错误 - After restarting the server instance, Capistrano throws the error that Authentication failed for user Net::SSH::AuthenticationFailed Capistrano Net :: SSH :: AuthenticationFailed - Capistrano Net::SSH::AuthenticationFailed Capistrano-Net :: SSH :: AuthenticationFailed - Capistrano - Net::SSH::AuthenticationFailed 使用capistrano部署时,Net :: SSH :: AuthenticationFailed - Net::SSH::AuthenticationFailed when deploying with capistrano cap production deploy error Net :: SSH :: AuthenticationFailed:身份验证失败 - cap production deploy error Net::SSH::AuthenticationFailed: Authentication failed 无法使用Net :: SSH :: AuthenticationFailed运行cap production deploy:initialed:用户身份验证失败? - Cannot run cap production deploy:initial with Net::SSH::AuthenticationFailed: Authentication failed for user? Rails 4 + Capistrano + AWS Net :: SSH :: AuthenticationFailed:部署 - Rails 4 + Capistrano + AWS Net::SSH::AuthenticationFailed: deploy
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM