【发布时间】:2015-01-18 03:46:21
【问题描述】:
我想使用 ssh-agent 将我的密钥转发到 docker 映像并从私有 github 存储库中提取。
我在 Yosemite 上使用带有 boot2docker 的 https://github.com/phusion/passenger-docker 的略微修改版本。
ssh-add -l
...key details
boot2docker up
然后我使用我在很多地方看到的命令(即https://gist.github.com/d11wtq/8699521):
docker run --rm -t -i -v $SSH_AUTH_SOCK:/ssh-agent -e SSH_AUTH_SOCK=/ssh-agent my_image /bin/bash
但它似乎不起作用:
root@299212f6fee3:/# ssh-add -l
Could not open a connection to your authentication agent.
root@299212f6fee3:/# eval `ssh-agent -s`
Agent pid 19
root@299212f6fee3:/# ssh-add -l
The agent has no identities.
root@299212f6fee3:/# ssh git@github.com
Warning: Permanently added the RSA host key for IP address '192.30.252.128' to the list of known hosts.
Permission denied (publickey).
【问题讨论】:
-
文件$SSH_AUTH_SOCK的权限是什么?
标签: macos docker ssh boot2docker