![](/img/trans.png)
[英]Capistrano 3.5 Net::SSH::AuthenticationFailed: Authentication failed
[英]Capistrano: Authentication failed for user ubuntu@xx.xxx.xxx.xxx (Net::SSH::AuthenticationFailed)
我可以通過ssh ubuntu@xx.xxx.xxx.xxx
連接。 但不是通過cap production deploy:check
當前的
set :user, "ubuntu"
set :ssh_options, { forward_agent: true }
server "xx.xxx.xxx.xxx",
user: fetch(:user),
roles: %w[web app db]
試過了
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]
“當前”曾經是我為其他項目設置的,我只需要ssh-add
然后cap production deploy
發生了什么變化? 還是我的配置不正確?
問題:通過 capistrano 對用戶 ubuntu@xx.xxx.xxx.xxx (Net::SSH::AuthenticationFailed) 進行身份驗證失敗,但可以直接 ssh
調試:
sudo tail -f /var/log/auth.log
在服務器上cap production deploy:check
我的本地auth.log
userauth_pubkey: key type ssh-rsa not in PubkeyAcceptedAlgorithms [preauth]
中解決方案:
/etc/ssh/sshd_config
PubkeyAuthentication
然后取消注釋(刪除#
)PubkeyAcceptedKeyTypes=+ssh-rsa
sudo systemctl restart sshd
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.