天道酬勤,学无止境

Capistrano error : could not connect to ssh-agent

I'm using Bedrock with Capistrano deploys.
When I use command bundle exec cap staging deploy:check I get an authentication error :

...
D, [2015-05-09T15:39:53.878464 #15636] DEBUG -- net.ssh.authentication.session[1e34a58]: trying publickey
D, [2015-05-09T15:39:53.878464 #15636] DEBUG -- net.ssh.authentication.agent[1e30d2c]: connecting to ssh-agent
E, [2015-05-09T15:39:53.879447 #15636] ERROR -- net.ssh.authentication.agent[1e30d2c]: could not connect to ssh-agent
E, [2015-05-09T15:39:53.879447 #15636] ERROR -- net.ssh.authentication.session[1e34a58]: all authorization methods failed (tried publickey)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as deploy@SERVER_IP: Authentication failed for user deploy@SERVER_IP
Tasks: TOP => git:check => git:wrapper

Capistrano could not connect to ssh-agent on my server.

But I can log in on my server via SSH like this ssh deploy@SERVER_IP without password. I dit all the instructions in Capistrano Authentication & Authorisation Docs page, so I can use command like me@localhost $ ssh deploy@one-of-my-servers.com 'hostname; uptime'.

If I enter command ssh -A deploy@SERVER_IP 'env | grep SSH_AUTH_SOCK' I get result

SSH_AUTH_SOCK=/tmp/ssh-UweQkw7578/agent.7578

Here is my deploy.rb file :

set :application, 'APP'
set :repo_url, 'URL'
set :branch, :master
set :tmp_dir, '~/tmp'
set :log_level, :info
set :linked_files, fetch(:linked_files, []).push('.env')
set :linked_dirs, fetch(:linked_dirs, []).push('web/app/uploads')

Here is my staging.rb file :

set :stage, :staging
set :deploy_to, -> { "/var/www/vhosts/project/dev" }
server 'SERVER_IP', user: 'deploy', roles: %w{web app}
set :ssh_options, {
  user: 'deploy',
  keys: %w('/c/Users/alexander/.ssh/id_rsa'),
  forward_agent: true,
  auth_methods: %w(publickey),
  verbose: :debug
}
fetch(:default_env).merge!(wp_env: :staging)

Apache's agent forwarding agent instruction is enabled in sshd_config file : AllowAgentForwarding yes

What should do with my config files to make my deploy work?

Windows 8.1
Ruby 2.2.0
Capistrano 3.2.1
Git Bash

评论

OK so I had the same issue, and I spent way too long working out exactly what is happening here, and the upshot is -

  • for ruby on windows, you must run pagent, not ssh-agent, for Capistrano and agent forwarding to work - in fact pretty much any tool that uses the Ruby net-ssh library on Windows.

And I dont think that will change, at least not for a while.

Agent Forwarding

See An Illustrated Guide to SSH Agent Forwarding for more about agent forwarding, and how the key challenge ends back up on our workstation.

Terminology

  • workstation - the machine (Windowa server/desktop/laptop) our SSH client software is running from, and, most importantly, our PKI private key is stored on (with or without a passphrase)

  • deployment node - the target of our Capistrano deployment task, most like defined in the 'server' key in our config/deploy.rb, or config/deploy/.rb file

  • git repo - where we will pull the code from, first queried via "git ls-remote" - we will access this git repo via SSH, and the deployment node will use agent forwarding to pass the key challenge back to the workstation

  • SSH client software - how we reach out to sshd on remote servers, and which has access to our private key. Might be putty, an OpenSSH ssh client or the net-ssh library in Ruby.

Setup

I have a Windows 7 workstation box, with Git-Bash, and its OpenSSH ssh client, plus the script from Joe Reagle that sets up some environmental variables that say which port and pid the ssh-agent is operating on.

I also have Putty and Pageant, but I focussed, initially, on just the OpenSSH/Git-Bash tools.

I have set up passwordless ssh from the workstation to the deployment node, I have the ssh-agent running, I have my key added through ssh-add, and I have my public key registered as a read-only access key to the git repo.

Basics

So we are trying to use SSH agent forwarding to have Capistrano pull from our Git repo onto our deployment node.

Now we can test this all ourselves by setting up our public SSH key on the deployment node and using, say, the OpenSSH ssh client, to confirm we have passwordless ssh working. Then we can setup ssh-agent by

  1. starting ssh-agent and setting the SSH_AUTH_SOCK and SSH_AGENT_PID as required.
  2. adding our private key to the ssh-agent via ssh-add
  3. add our public key as an authorised key to the git repo
  4. ssh to the deployment node, and from there do a "git ls-remote git@" (or a ssh -T git@)

If everything is setup correctly, this will all work, and so we will think "ok I can do a 'cap deploy:check'" - and it will fail.

What Went Wrong

We will get an error

"Error reading response length from authentication socket"

Who is telling us this ? It isnt immediately clear, but it

  • isn't the git repo

  • it isnt the git client on the deployment node

  • it isnt the sshd daemon on the deployment node, that wants to pass the key challenge back to the workstation.

Its the Ruby ssh client library on the workstation.

How do we know this

In the ssh_options hash in the deploy.rb file, we add the following : verbose: :debug

When we do this we see this message

  • Pageant not running.

Why is Capistrano trying to use Pageant instead of ssh-agent

When running via Capistrano, the ssh client is different to the one you used when verifying things by hand.

When verifying by hand, it was an OpenSSH ssh client. Now it is the net-ssh library in Ruby.

And on Windows, net-ssh has these lines

if Net::SSH::Authentication::PLATFORM == :win32
  require 'net/ssh/authentication/pageant'
end

or

case Net::SSH::Authentication::PLATFORM
when :java_win32
  require 'net/ssh/authentication/agent/java_pageant'
else
  require 'net/ssh/authentication/agent/socket'

So loading pageant is hard-coded into net-ssh. It doesnt even try to see if you are running under a unix-like shell (like git-bash or cygwin), and to then use the unix-domain ssh-agent SSH_AUTH_SOCK

At present net-ssh doesnt try to open a unix-domain named socket. In theory I think it could, through the UNIXSocket class in the stdlib. But I haven't experimented with that on a Windows machine yet.

受限制的 HTML

  • 允许的HTML标签:<a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • 自动断行和分段。
  • 网页和电子邮件地址自动转换为链接。

相关推荐
  • 部署 Rails 应用程序时,使用 Capistrano 3 的 SSH 代理转发不起作用(SSH agent forwarding with Capistrano 3 not working when deploying Rails app)
    问题 我的 deploy.rb 中有以下设置 set :application, 'sample_app' set :repo_url, 'user@123.45.67.100:/home/user/railsapps/sample_app' set :deploy_to, '/var/www/sample_app' set :user, "user" set :ssh_options, { :forward_agent => true } 和我的 deploy/production.rb 文件: set :stage, :production server '123.45.67.200', user: 'user', roles: %w{app db web} 运行 cap production deploy 时出现以下错误:检查 DEBUG [] ssh: connect to host 123.45.67.100 port 22: Connection timed out DEBUG [] fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. (Backtrace
  • Rails 4 + Capistrano 3:致命:部署时无法从远程存储库读取(Rails 4 + Capistrano 3 : fatal: Could not read from remote repository while deploying)
    问题 使用 Capistrano 3 部署 Rails 4 应用程序时出现以下错误 INFO [87512eb8] Running /usr/bin/env chmod +x /tmp/magnificent/git-ssh.sh as deploy@104.236.6.180 DEBUG [87512eb8] Command: /usr/bin/env chmod +x /tmp/magnificent/git-ssh.sh INFO [87512eb8] Finished in 0.444 seconds with exit status 0 (successful). INFO [1ec94dd1] Running /usr/bin/env git ls-remote --heads git@github.com:BoTreeConsultingTeam/magnificent.git as deploy@104.236.6.180 DEBUG [1ec94dd1] Command: ( GIT_ASKPASS=/bin/echo GIT_SSH=/tmp/magnificent/git-ssh.sh /usr/bin/env git ls-remote --heads git@github.com:BoTreeConsultingTeam/magnificent.git )
  • 升级到 macOS 10.12 (Sierra) 后使用 Capistrano 部署代码时出现问题,“权限被拒绝(公钥)”。(Problems deploying code with Capistrano since upgrading to macOS 10.12 (Sierra), “Permission denied (publickey).”)
    问题 所以我刚刚将我的 Mac mini(2012 年末)升级到 macOS 10.12(Sierra),一切看起来都很好,但是我在使用 Capistrano 部署代码时遇到了一个奇怪的问题。 我收到以下错误: Permission denied (publickey). 在 Mac OS X 10.11 (El Capitan) 或之前的任何版本中从未出现过此问题。 为什么现在突然发生这种情况? 下面是失败的 Capistrano 部署的完整输出: jakes_mac:SomeCode jake$ cap staging deploy INFO [hkdgad21] Running /usr/bin/env mkdir -p /tmp/somecode/ as jake@example.com DEBUG [hkdgad21] Command: /usr/bin/env mkdir -p /tmp/somecode/ jake@example.com's password: INFO [hkdgad21] Finished in 5.166 seconds with exit status 0 (successful). DEBUG Uploading /tmp/somecode/git-ssh.sh 0.0% INFO Uploading /tmp/somecode/git
  • Capistrano deployment from Windows using forward_agent option: “Error reading response length from authentication socket.”
    I'm trying to deploy a project using Capistrano. My development machine is running Windows 7; the server I'm deploying onto is Linux. In the deploy.rb script, the following is set: ssh_options[:forward_agent] = true The Capistrano script starts off by running a git command locally, at which point I'm prompted for the passphrase for my SSH key: * executing `deploy:update_code' executing locally: "git ls-remote git@github.com:pathto/gitproject.git develop" Enter passphrase for key '/c/Users/Sam/.ssh/id_rsa': command finished in 6999ms (I've removed the real git path from the above as you can
  • 使用 forward_agent 选项从 Windows 部署 Capistrano:“从身份验证套接字读取响应长度时出错。”(Capistrano deployment from Windows using forward_agent option: “Error reading response length from authentication socket.”)
    问题 我正在尝试使用 Capistrano 部署一个项目。 我的开发机器运行的是 Windows 7; 我部署到的服务器是 Linux。 在 deploy.rb 脚本中,设置了以下内容: ssh_options[:forward_agent] = true Capistrano 脚本首先在本地运行 git 命令,此时系统会提示我输入 SSH 密钥的密码: * executing `deploy:update_code' executing locally: "git ls-remote git@github.com:pathto/gitproject.git develop" Enter passphrase for key '/c/Users/Sam/.ssh/id_rsa': command finished in 6999ms (我已经从上面删除了真正的 git 路径,你可能会看到。) 我输入了我的密码,这很好用。 然而,Capistrano 然后尝试在远程机器上做类似的事情(在下面重命名为 staging-server.com),我收到一个错误——请参阅此摘录的最后一行: [staging-server.com] executing command [staging-server.com] sh -c 'git clone git@github.com:pathto
  • Capistrano SSH :: AuthenticationFailed,不提示输入密码(Capistrano SSH::AuthenticationFailed, not prompting for password)
    问题 我已经成功使用了capistrano一段时间了,突然间,在我失去了部署能力的每个项目中。 环境: os X(小牛) 红宝石1.9.3p194 rvm(本地,不在服务器上) 导轨3.2及以上 RubyGems 1.8.25 我没有使用rsa_keys或我想要capistrano提示输入用户名和密码的任何东西。 突然,它决定不要求输入密码,而是要求用户输入。 然后它回滚并给我以下错误。 [deploy:update_code] exception while rolling back: Capistrano::ConnectionError, connection failed for: sub.example.com (Net::SSH::AuthenticationFailed: Authentication failed for user user@sub.example.com) connection failed for: sub.example.com (Net::SSH::AuthenticationFailed: Authentication failed for user user@sub.example.com) 这是在我的个人笔记本电脑和工作中的iMac上发生的。 部署到两个不同的服务器(两个linux)时会发生 我在这里完全不知所措。 有任何想法吗?
  • SSHKit :: Runner :: ExecuteError(SSHKit::Runner::ExecuteError)
    问题 $ bundle exec cap production deploy (回溯仅限于导入的任务)上限已中止! SSHKit :: Runner :: ExecuteError: 以Psara @ sakura执行时发生异常:git退出状态:128 git stdout:未编写任何内容git stderr:权限被拒绝(公钥)。 致命:远端意外挂断 SSHKit :: Command ::失败: git退出状态:128 git stdout:什么都没写 git stderr:权限被拒绝(公钥)。 致命:远端意外挂断任务:TOP => git:check(通过使用--trace运行任务来查看完整的跟踪信息)部署失败,并显示以下错误: 以Psara @ sakura执行时发生异常: git退出状态:128 git stdout:没写什么 git stderr:权限被拒绝(公钥)。 致命:远端意外挂断 * deploy.rb 设置:application,'Psara' 设置:repo_url,'git@bitbucket.org:CBLaughter / psara.git' 设置:deploy_to,'/ home / Psara / Psara' 设置:default_run_options,:pty => true 名称空间:deploy do 在:restart之后,
  • 尽管有 SSH 密钥,但 Capistrano 在部署时要求输入密码(Capistrano asks for password when deploying, despite SSH keys)
    问题 我的 ssh 密钥绝对设置正确,因为在使用 ssh 时从未提示我输入密码。 但是在使用cap deploy时, capistrano 仍然要求输入密码。 奇怪的是,当我使用cap deploy:setup时,它不会要求输入密码。 如果没有密码提示,它会使部署周期更加顺畅。 细节:我正在将 Sinatra 应用程序部署到 Dreamhost 共享帐户(使用Passenger)。 很久以前我就按照教程进行了操作,当时效果很好。 从那以后有些东西坏了。 我正在使用 capistrano (2.5.9) 和 git 版本 1.6.1.1。 这是我的 Capfile: load 'deploy' if respond_to?(:namespace) # cap2 differentiator set :user, 'ehsanul' set :domain, 'jellly.com' default_run_options[:pty] = true # the rest should be good set :repository, "ehsanul@jellly.com:git/jellly.git" set :deploy_to, "/home/ehsanul/jellly.com" set :deploy_via, :remote_cache set :scm, 'git'
  • “无法打开与您的身份验证代理的连接”,即使在 ssh-agent 启动后 ssh-add 也会出错(“Could not open a connection to your authentication agent” ,ssh-add error even after ssh-agent started)
    问题 我需要添加多个 ssh 密钥,所以我需要执行ssh-add 但我收到Could not open a connection to your authentication agent错误 我阅读了很多帖子,例如无法打开与您的身份验证代理的连接和 https://superuser.com/questions/901568/ssh-agent-could-not-open-connection 我已经启动了 ssh-agent eval ($ssh-agent -s) 输出类似于:Agent pid 13524 但仍然收到此错误: $ ssh-add ~/.ssh/id_rsa Could not open a connection to your authentication agent. 我也设置 git config --global url."https://".insteadOf git:// 我回显一些变量并得到这个: echo $SSH_AGENT_PID 12340 echo $SSH_AUTH_SOCK /tmp/ssh-ZbRZr10908/agent.10908 PS:我使用的是Windows 7和公司下的网络。 回答1 我在网上尝试了很多解决方案,但没有任何效果。 我做了更多的研究,发现以下命令有效。 须藤 ssh-agent bash ssh 添加
  • “Could not open a connection to your authentication agent” ,ssh-add error even after ssh-agent started
    I need to add multiple ssh keys , so i need to execute ssh-add But I get error of Could not open a connection to your authentication agent I read multiply posts like Could not open a connection to your authentication agent and https://superuser.com/questions/901568/ssh-agent-could-not-open-connection I had started the ssh-agent by eval ($ssh-agent -s) and the output is like : Agent pid 13524 but still get this error: $ ssh-add ~/.ssh/id_rsa Could not open a connection to your authentication agent. I also set git config --global url."https://".insteadOf git:// And I echo some variable and get
  • 无法打开与您的身份验证代理的连接(Could not open a connection to your authentication agent)
    问题 我遇到了以下错误: $ git push heroku master Warning: Permanently added the RSA host key for IP address '50.19.85.132' to the list of known hosts. ! Your key with fingerprint b7:fd:15:25:02:8e:5f:06:4f:1c:af:f3:f0:c3:c2:65 is not authorized to access bitstarter. 我尝试添加密钥,但出现以下错误: $ ssh-add ~/.ssh/id_rsa.pub Could not open a connection to your authentication agent. 回答1 您是否启动了ssh-agent ? 在运行ssh-add命令之前,您可能需要启动ssh-agent : eval `ssh-agent -s` ssh-add 请注意,这将在 Windows 上启动 msysgit Bash的代理。 如果您使用的是不同的 shell 或操作系统,则可能需要使用命令的变体,例如其他答案中列出的那些。 请参阅以下答案: ssh-add 抱怨:无法打开与您的身份验证代理的连接 Git push 需要用户名和密码(包含如何使用 ssh
  • 无法打开与身份验证代理的连接(Could not open a connection to your authentication agent)
    问题 我遇到以下错误: $ git push heroku master Warning: Permanently added the RSA host key for IP address '50.19.85.132' to the list of known hosts. ! Your key with fingerprint b7:fd:15:25:02:8e:5f:06:4f:1c:af:f3:f0:c3:c2:65 is not authorized to access bitstarter. 我试图添加密钥,但在下面出现此错误: $ ssh-add ~/.ssh/id_rsa.pub Could not open a connection to your authentication agent. 回答1 您是否已启动ssh-agent ? 在运行ssh-add命令之前,可能需要启动ssh-agent : eval `ssh-agent -s` ssh-add 请注意,这将启动Windows上的msysgit Bash代理。 如果您使用的是其他Shell或操作系统,则可能需要使用命令的变体,例如其他答案中列出的命令。 请参阅以下答案: ssh-add抱怨:无法打开与身份验证代理的连接 Git push需要用户名和密码(包含有关如何使用ssh-agent的详细说明)
  • Git Bash:无法打开与您的身份验证代理的连接 [重复](Git Bash: Could not open a connection to your authentication agent [duplicate])
    问题 这个问题在这里已经有了答案: 无法打开与您的身份验证代理的连接(37 个回答) 1 年前关闭。 我是 Github 的新手,生成 SSH 密钥看起来很有必要。 并且被我的老板告知了这件事,所以我需要遵守。 我成功创建了 SSH 密钥,但是当我要将其添加到 ssh-agent 时 这就是发生的事情 似乎是什么问题? 回答1 在使用它之前,您似乎需要运行ssh-agent : eval `ssh-agent -s` 该问题已在本主题中得到解答:无法打开与您的身份验证代理的连接 回答2 我检查了这篇文章和上面@kenorb 引用的文章中的所有解决方案,但没有找到任何对我有用的解决方案。 我在 Windows 7 上使用 Git 1.9.5 预览版,配置如下: - 从 Windows 命令提示符运行 Git - 签出 Windows 风格,提交 Unix 风格的行尾 我使用了“ Git Bash ”控制台来处理所有事情……一切都很好,直到我尝试安装 SSH 密钥。 GitHub 的文档说要执行以下操作(在阅读完帖子之前不要运行这些命令) : 确保 ssh-agent 已启用: 如果您使用的是 Git Bash,请打开 ssh-agent: # start the ssh-agent in the background ssh-agent -s # Agent pid 59566
  • 如何解决“paramiko.ssh_exception.SSHException:无法从 ssh-agent 获取密钥”(How to solve "paramiko.ssh_exception.SSHException: could not get keys from ssh-agent")
    问题 我正在尝试使用 Paramiko Python 模块通过 SSH 连接到远程服务器。 在 CentOS 7 服务器上使用 Python 3.6.7 版安装。 但是出现以下错误。 python import paramiko >>> ssh = paramiko.SSHClient() >>> ssh.load_system_host_keys() >>> ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) >>> ssh.connect("19.16.2.2", username="user1", password="pass") Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python3.6/site-packages/paramiko/client.py", line 424, in connect passphrase, File "/usr/local/lib/python3.6/site-packages/paramiko/client.py", line 643, in _auth self._agent = Agent() File "/usr/local
  • How to solve "paramiko.ssh_exception.SSHException: could not get keys from ssh-agent"
    I'm trying to connect to remote server through SSH using Paramiko Python module. Installed using Python version 3.6.7 on CentOS 7 server. But getting this following error. python import paramiko >>> ssh = paramiko.SSHClient() >>> ssh.load_system_host_keys() >>> ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) >>> ssh.connect("19.16.2.2", username="user1", password="pass") Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python3.6/site-packages/paramiko/client.py", line 424, in connect passphrase, File "/usr/local/lib/python3.6/site-packages
  • 如何在SSH会话中转发本地密钥对?(How to forward local keypair in a SSH session?)
    问题 我通过SSH手动部署网站,我在github / bitbucket中管理源代码。 对于每个新站点,我目前正在服务器上生成一个新的密钥对,并将其添加到github / bitbucket中,以便可以从服务器中获取机会。 我在capistrano中遇到了一个功能,该功能使用本地计算机的密钥对将更新拉到服务器,即ssh_options[:forward_agent] = true 我该怎么做,将本地计算机的密钥对转发到我正在SSH连接的服务器上,这样我就可以避免为每个新站点将密钥添加到github / bitbucket中。 回答1 事实证明这很简单,完整的指南在这里使用SSH转发 本质上,如果~/.ssh/config文件不存在,则需要创建它。 然后,添加主机(文件中的域名或IP地址,并设置ForwardAgent yes ) 样例代码: Host example.com ForwardAgent yes 使SSH生活变得更加轻松。 回答2 创建〜/ .ssh / config 填写(主机地址是您要允许信用凭证转发到的主机的地址): Host [host address] ForwardAgent yes 如果尚未运行ssh-agent,请运行它: ssh-agent 从该命令中获取输出,并将其粘贴到终端中。 这将设置环境变量,需要设置这些环境变量才能使代理转发正常工作。 (可选
  • 如何解决“sign_and_send_pubkey:签名失败:代理拒绝操作”?(How to solve “sign_and_send_pubkey: signing failed: agent refused operation”?)
    问题 使用 SSH 密钥配置新的 Digital Ocean Droplet。 当我运行ssh-copy-id这就是我得到的: ssh-copy-id user@012.345.67.89 /usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed /usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys sign_and_send_pubkey: signing failed: agent refused operation user@012.345.67.89's password: Number of key(s) added: 1 Now try logging into the machine, with: "ssh 'user@012.345.67.89'" and check to make sure that only the key(s) you wanted were added. 但是,当我尝试通过 ssh 登录时
  • 无法打开与身份验证代理的连接(Could not open a connection to your authentication agent)
    问题 我遇到以下错误: $ git push heroku master Warning: Permanently added the RSA host key for IP address '50.19.85.132' to the list of known hosts. ! Your key with fingerprint b7:fd:15:25:02:8e:5f:06:4f:1c:af:f3:f0:c3:c2:65 is not authorized to access bitstarter. 我试图添加密钥,但在下面出现此错误: $ ssh-add ~/.ssh/id_rsa.pub Could not open a connection to your authentication agent. 回答1 您是否已启动ssh-agent ? 在运行ssh-add命令之前,可能需要启动ssh-agent : eval `ssh-agent -s` ssh-add 请注意,这将启动Windows上的msysgit Bash代理。 如果您使用的是其他Shell或操作系统,则可能需要使用命令的变体,例如其他答案中列出的命令。 请参阅以下答案: ssh-add抱怨:无法打开与身份验证代理的连接 Git push需要用户名和密码(包含有关如何使用ssh-agent的详细说明)
  • /usr/bin/env ruby​​ 没有这样的文件或目录:使用 capistrano 3、capistrano/rbenv、capistrano/bundler 和 capistrano/rails(使用 rails 4)(/usr/bin/env ruby no such file or directory: Using capistrano 3, capistrano/rbenv, capistrano/bundler and capistrano/rails (using rails 4))
    问题 我正在使用 capistrano、capistrano/rbenv、capistrano/bundler 和 capistrano/rails。 我在 capistrano 编译资产的步骤中收到此错误: DEBUG [49a50df6] /usr/bin/env: DEBUG [49a50df6] ruby DEBUG [49a50df6] : No such file or directory DEBUG [49a50df6] 在生产服务器中/usr/bin/env ruby -v是正确的。 我知道这一点:why-does-some-work-in-my-ssh-session-but-not-in-capistrano 但我无法让它工作。 这是我的Capfile : # Load DSL and Setup Up Stages require 'capistrano/setup' # Includes default deployment tasks require 'capistrano/deploy' # Includes tasks from other gems included in your Gemfile # # For documentation on these, see for example: # # https://github.com
  • 为什么 ssh-agent 需要 root 访问权限?(Why does ssh-agent need root access?)
    问题 我刚刚安装了 Archbang,正在尝试克隆我的一个 Git 项目,这需要 SSH 密钥。 过去,我在 Ubuntu 和 RedHat 机器上遵循 Github 指南获得成功,但由于某种原因,它在我的新 Arch 安装中不起作用。 我已经使用以下命令成功生成了我的 SSH 公钥/私钥对: ssh-keygen -t rsa -b 4096 -C "email@address" 但是当我继续启动 SSH 代理并添加我的公钥时,我遇到了问题。 [user@arch ~]$ eval "$(ssh-agent -s)" bind: Permission denied unix_listener: cannot bind to path: /tmp/ssh-ZqYqSabxjZeA/agent.9328 但是,如果我以 root 身份运行它,这是成功的: [user@arch ~]$ eval "$(sudo ssh-agent -s)" [sudo] password for user: Agent pid 9146 但是我很确定我不想以 root 身份执行 SSH 操作。 继续前进,当我尝试使用ssh-add ,我也会收到权限错误,但这次是标准用户和 root 用户: [user@arch ~]$ ssh-add .ssh/id_rsa.pub Could not open a