SSH代理转发不起作用 [英] SSH Agent Forwarding not working

查看:554
本文介绍了SSH代理转发不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很难尝试配置Capistrano 3.1来部署托管在Github上的应用程序。 我正在关注 Capistrano文档,并且我已成功完成第一步(从工作站到服务器的SSH密钥)和第二步(从我们的服务器到版本库主机)我能够成功运行 ssh -A deploy@one-of-my-servers.com'git ls-remote git@github.com:my_user / my_repo.git'

  18f38afz261df35d462f7f4e2ca847d22f148a06 HEAD 
18f38afz261df35d462f7f4e2ca847d22f148a06 refs / heads / master

但是, ssh deploy@one-of-my-servers.com'git ls-remote git @ github .com:my_user / my_repo.git'失败:

 权限被拒绝(publickey)。 

Capistrano文件暗示


如果您收到错误主机密钥验证失败。登录到您的服务器并以部署用户身份运行命令ssh git@github.com将github.com添加到已知主机列表中。

SO,我试过但是我得到了

  ssh git@github.com 
警告:永久添加IP地址'192.30.252.131'的RSA主机密钥添加到已知主机列表中。
权限被拒绝(publickey)。

我基本上无法成功访问Github仓库。



SSH文档指出:


  -A启用身份验证代理连接的转发。此
也可以在配置
文件中以每台主机为单位指定。


如何在配置中以主机为单位指定文件?



我的本​​地机器运行Mac OSX Mavericks。
VPS运行Ubuntu 12.04



感谢。

解决方案

你有你的SSH密钥添加到代理身份列表?



您可以检查 ssh-add -L

  $ ssh-add -L 
ssh-rsa AAAAB3N ..... 0VmSiRvTzBrbU0ww == /Users/youruser/.ssh/id_rsa

如果您没有看到用于github的ssh密钥或消息,如

lockquote

代理没有身份。

然后您应该添加您的密钥:

  ssh-add〜/ .ssh / id_rsa 

(替换为您用于github的键的路径)



请参阅 ssh-add doc 获取更多信息


I'm having an hard time trying to configure Capistrano 3.1 to deploy an app hosted on Github.

I'm following Capistrano Documentation and I have successfully completed the first step (SSH keys from workstation to servers) and on the second one (From our servers to the repository host) I'm able to successfully run ssh -A deploy@one-of-my-servers.com 'git ls-remote git@github.com:my_user/my_repo.git':

18f38afz261df35d462f7f4e2ca847d22f148a06    HEAD
18f38afz261df35d462f7f4e2ca847d22f148a06    refs/heads/master

however, ssh deploy@one-of-my-servers.com 'git ls-remote git@github.com:my_user/my_repo.git' fails:

Permission denied (publickey).

Capistrano docs suggests

If you get the error "host key verification failed." log in into your server and run as the deploy user the command ssh git@github.com to add github.com to the list of known hosts.

SO, I tried so but I get

ssh git@github.com
Warning: Permanently added the RSA host key for IP address '192.30.252.131' to the list of known hosts.
Permission denied (publickey).

And I'm basically not able to successfully access the Github repo.

SSH documentation states:

-A      Enables forwarding of the authentication agent connection.  This
         can also be specified on a per-host basis in a configuration
         file.

How can I specified on a per-host basis in a configuration file?

My local machine runs Mac OSX Mavericks. The VPS runs Ubuntu 12.04

Thanks.

解决方案

Do you have your ssh key added to the list of agent identites ?

You can check with ssh-add -L , you should see the key your are using to connect to github :

$ ssh-add -L
ssh-rsa AAAAB3N.....0VmSiRvTzBrbU0ww== /Users/youruser/.ssh/id_rsa

If you don't see the ssh key you use for github or a message like

The agent has no identities.

Then you should add your key with :

ssh-add ~/.ssh/id_rsa

(replace with the path to the key you use for github)

See the ssh-add doc for more info

这篇关于SSH代理转发不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆