[英]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
在服务器上cap production deploy:check
on my localcap production deploy:check
我的本地userauth_pubkey: key type ssh-rsa not in PubkeyAcceptedAlgorithms [preauth]
appeared from auth.log
auth.log
userauth_pubkey: key type ssh-rsa not in PubkeyAcceptedAlgorithms [preauth]
中solution:解决方案:
/etc/ssh/sshd_config
/etc/ssh/sshd_config
PubkeyAuthentication
then uncomment(remove #
)PubkeyAuthentication
然后取消注释(删除#
)PubkeyAcceptedKeyTypes=+ssh-rsa
PubkeyAcceptedKeyTypes=+ssh-rsa
sudo systemctl restart sshd
sudo systemctl restart sshd
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.