-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot forward SSH agent to Docker #4842
Comments
Had very similar issue. The SSH forwarding is fine, it seems to be going to the wrong agent. It appears that with 2.3.0.4 (not sure about earlier versions), the SSH forwarding seems to work only when you add keys to the ssh-agent Docker Desktop (?) has started. Reproduce:
My the theory: this happens because now containers talk to the wrong agent, that does not have the identity we just added. I think the reason this is a widespread problem is that a lot of people have Docker Desktop starting automatically, and also have a habit to do What worked for me:
Infosec aside, from my (end-user) perspective, the fact that I have to use a specific agent for things to work is not obvious. I think of containers as "clients" for the agent that I control (started), rather than thinking of the docker engine as a "server" providing its own agent for me to use. At any rate, I think it deserves a 2x4 red banner with skull and bones and biohazard signs in documentation. In linux you explicitly specify the socket path so this problem does not exist at all. From this perspective, while SSH agent forwarding is a valid narrow-case solution for a busy engineer, I would very much like to see a proper socket forwarding the way it is done in Linux. |
@dbarvitsky I am having the same issue using the steps you provided my docker-for-mac version and docker version:
I am using so far the edge version as I heard it works better with it but it doesn't seem to do so |
Issues go stale after 90 days of inactivity. Prevent issues from auto-closing with an If this issue is safe to close now please do so. Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. |
This issue is still happening. Docker for Mac: What information is needed to fix this problem? It is very frustrating to deal with. The only workaround I've found is to launch Docker from the terminal, but that's not very helpful or user friendly. Please let me know if there is any additional information I can provide. |
Ah, I see the issue. I removed I still find it a bit weird that Docker for Mac can't find/use the Is this a bug with the |
As I saw it, the agent has it's own ssh-agent spinning up anyways, so you could just connect and add your keys once and it should persistent across restarts of the container. Not a perfect patch but so far it works |
Also, I have no knowledge on how to fix this and waiting for someone with more 🧠 in the issue to chime in |
Am also seeing this on MacOS. Running Docker for Mac: |
Can we keep this open? |
@rhiannon-eldridge-lrn If you want to keep using it, add this line in your zstyle :omz:plugins:ssh-agent agent-forwarding on This line must be before : source $ZSH/oh-my-zsh.sh In my plugins=(git z ssh-agent zsh-autosuggestions colored-man-pages zsh-syntax-highlighting history-substring-search)
zstyle :omz:plugins:ssh-agent agent-forwarding on
source $ZSH/oh-my-zsh.sh |
Closed issues are locked after 30 days of inactivity. If you have found a problem that seems similar to this, please open a new issue. Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. |
Expected behavior
Given what has been stated here and here, I'd expect that these two command to produce the same output:
Actual behavior
Information
Am I missing anything? Is it possible to forward the SSH agent of the Mac host to Docker containers?
The text was updated successfully, but these errors were encountered: