dr.*_*lix 4 capistrano ruby-on-rails
我可以通过 进行连接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]
Run Code Online (Sandbox Code Playgroud)
尝试过
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]
Run Code Online (Sandbox Code Playgroud)
“当前”曾经是我对其他项目的设置,我只需要ssh-add然后cap production deploy
发生了什么变化?或者我的配置不正确?
dr.*_*lix 16
问题:用户 ubuntu@xx.xxx.xxx.xxx (Net::SSH::AuthenticationFailed) 通过 capistrano 身份验证失败,但可以直接 ssh
调试:
sudo tail -f /var/log/auth.log在服务器上cap production deploy:check然后在我本地尝试userauth_pubkey: key type ssh-rsa not in PubkeyAcceptedAlgorithms [preauth]出现于auth.log解决方案:
/etc/ssh/sshd_config
PubkeyAuthentication然后取消注释(删除#)PubkeyAcceptedKeyTypes=+ssh-rsasudo systemctl restart sshd| 归档时间: |
|
| 查看次数: |
2143 次 |
| 最近记录: |