git - Capistrano 无法让 git 工作
问题描述
我添加了一个 deploy.pub 密钥以在 github 存储库上部署密钥,但由于某种原因cap <env> deploy
给了我这个错误。当我在服务器上时,我也无法克隆 repo,我收到权限错误。如果我在服务器上 ssh-add 我的密钥,那么我可以克隆,但在cap <env> deploy
本地运行会创建一个新连接,并且密钥不再在钥匙串中。我错过了什么?
*** LOCAL GEMS ***
capistrano (3.4.0)
deploy.rb 包含:
set :ssh_options, {
forward_agent: true,
auth_methods: %w[publickey],
keys: %w[~/.ssh/my_local_rsa]
}
错误:
帽子流产了!
SSHKit::Runner::ExecuteError:以 deploy@server.com 执行时出现异常:git 退出状态:128
git stdout:没有写
git stderr:权限被拒绝(公钥)。
致命:无法从远程存储库中读取。
解决方案
当我将以下内容添加到我的~/.ssh/config
Host mydomain.com
ForwardAgent yes
我也跑了ssh-add ~/.ssh/my_local_rsa
推荐阅读
- javascript - 登录尝试失败后为我的密码获取 typeError
- javascript - 如何将事件中的目标对象发送到 Phaser 3 中的处理函数
- postgresql - 在 CASE 表达式中减去日期
- ruby - ATM 现金期权(票据)算法
- vb.net - 从数组填充datagridview
- c# - 如何使用不在上下文中的 linq-query 获取实体?
- c++ - 提取运算符错误地读入 0,但在类似情况下读入正确的数字
- kubernetes - 访问由 nginx-ingress 处理的 webapp 的子域
- java - DBUnit:NoSuchColumnException ColumnNameToIndexes 缓存映射中的非大写输入列。地图的列名不区分大小写
- python - 无法将 PDF 转换为文本格式