【发布时间】:2017-06-03 15:57:16
【问题描述】:
当我在远程服务器上为 ssh 密钥设置密码时,使用 Capistrano 部署失败。
但是当没有设置密码时它可以工作......
我希望能够在部署时输入密码,以便我仍然可以在服务器上使用密码。
错误:
01 mkdir -p /tmp
01 <user>@<ip> 0.183s
Uploading /tmp/git-ssh-<app>-<env>-<me>.sh 100.0%
02 chmod 700 /tmp/git-ssh-<app>-<env>-<me>.sh
02 <user>@<ip> 0.178s
git:check
01 git ls-remote --heads git@github.com:<me>/<my-repo>.git
01 Permission denied (publickey).
01 fatal: Could not read from remote repository.
01
01 Please make sure you have the correct access rights
01 and the repository exists.
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as <user>@<ip>: git exit status: 128
git stdout: Nothing written
git stderr: Permission denied (publickey).
fatal: Could not read from remote repository.
deploy.rb
lock '3.7.1'
set :application, '<app>'
set :repo_url, 'git@github.com:<me>/<app>.git'
set :user, '<user>'
set :scm_user, '<me>'
set :deploy_to, '/home/<user>/<app>'
set :scm, :git
set :branch, 'master'
append :linked_files, 'config/database.yml', 'config/secrets.yml'
append :linked_dirs, "log", "tmp/pids", "tmp/cache", "tmp/sockets", "vendor/bundle"
deploy/production.rb
server '<ip>', user: '<user>', roles: %w{app db web}
所以我希望 Capistrano 在部署时向我询问密码,以便我的服务器可以使用它来连接 github。
这可能吗?
【问题讨论】:
-
您是否尝试过按照 Capistrano 网站上的说明进行操作? capistranorb.com/documentation/getting-started/…
-
查看“SSH 代理转发”部分。
标签: ssh deployment capistrano digital-ocean ssh-keys