-
Notifications
You must be signed in to change notification settings - Fork 304
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
devcontainer.json option to forward SSH agent or provide SSH keys inside the container #106
Comments
This might enable Git repositories with ssh connections. (Need to test.) |
Related to #16. |
@chrmarti I tried getting this working outside of Linux and wasn't successful. There's an open issue in Docker for Mac on it: docker/for-mac#410 To make matters worse, on macOS, you can mount your SSH keys, but that doesn't work on Docker for Windows due to the permissive levels of bind mounts. At this point, I documented a copy-hack where you mount into a separate folder and then use postCreateCommand to copy to the correct location. We probably do need some sort of way to do this easily -- maybe we break down and provide an option to copy from |
As a workaround I've implemented ssh-agent-inject. Feedback would be welcome. |
Thanks @wkornewald . I have found a JavaScript library helping with this (muxrpc) so we don't need native binaries for the different platforms. |
@Chuxel FYI, our documentation will need an update: You can now add an SSH key to the local SSH agent and that will be available in the container. A prerequisite on Mac and Linux is that the environment variable SSH_AUTH_SOCK is set locally and available in VS Code. On Windows 10 it's enough for the ssh-agent (registered as a built-in service) to run (it's disabled by default) on the default socket path |
Verified on Windows by opening a new devcontainer then using the terminal to ssh. |
It would be great to have a built-in option in
devcontainer.json
that automatically sets up "SSH Agent forwarding" if an SSH Agent is available locally.Right now on Linux one needs to add the following, for example:
The text was updated successfully, but these errors were encountered: