Skip to content
This repository has been archived by the owner on Nov 30, 2023. It is now read-only.

Consider including details on sharing SSH keys for Git in definitions #135

Closed
Chuxel opened this issue Oct 9, 2019 · 5 comments
Closed
Labels
feature-request Request for new features or functionality

Comments

@Chuxel
Copy link
Member

Chuxel commented Oct 9, 2019

While microsoft/vscode-remote-release#106 is the real fix for this issue, we provide guidance on how to copy SSH keys into your container for use with git here.

We could include a simple script in the base dev containers that execute these steps and a postCreateCommand and mount point in devcontainer.json either by default, or can be un-commented in the mean time.

@Chuxel Chuxel added the feature-request Request for new features or functionality label Oct 9, 2019
@Chuxel
Copy link
Member Author

Chuxel commented Jan 17, 2020

This is no longer needed given we have first class support for SSH agent forwarding.

@Chuxel Chuxel closed this as completed Jan 17, 2020
@PavelSosin-320
Copy link

@Chuxel Sorry! Could you explain in the details what is it First-class support?
Do you mean that ssh client and git work via bridge network of the container host? So you have no problems with the host firewall. Is it really independent of the container's network driver? I tried it with the official alpine/git container and it was not too easy.
I also didn't find any documentation about how to inject credentials into the container in a secure manner. I familiar with this issue without storing it in the image and making it available for everybody who can access images or containers via plane docker -H host image/container inspect.

@Chuxel
Copy link
Member Author

Chuxel commented Apr 30, 2020

@zioalex
Copy link

zioalex commented Sep 21, 2021

Hi @Chuxel , I think this way is not good enough. Not everybody has Administrator access to run the agent on the Windows host.
Please can you provide a good way to copy the ssh key in the container?

At the moment trying to copy it with:
USER vscode
COPY ./ssh_config_dir/id_rsa /home/vscode/.ssh/id_rsa

produce the follow error:

[37057 ms] /bin/sh: 35: cannot create /home/vscode/.ssh/known_hosts: Permission denied
[37057 ms] Exit code 2
[37063 ms] Command in container failed: # Copy C:\Users\S0VP8H\.ssh\known_hosts to /home/vscode/.ssh/known_hosts
(dd iflag=fullblock bs=8192 count=0 2>/dev/null; dd iflag=fullblock bs=7821 count=1 2>/dev/null) >/home/vscode/.ssh/known_hosts

@hpe-ykoehler
Copy link

What about ssh "known_hosts"?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

4 participants