Replies: 1 comment
-
|
I tried setting up SSH with Dev Containers, but it was kind of messy. I followed their documentation, but it didn’t work for my setup. I ended up just using Git from a regular/local terminal, and it works perfectly because everything is bind-mounted anyway. Since we’re on a local machine, we don’t actually need to use Git from inside the container. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Context:
I have multiple accounts (eg work vs personal) I use for sites (eg, github.com). Each are tied to different SSH keys. I'm on Windows, but setup devContainers to wrap my projects. Some are for personal, and some for work. Within the host, I can just configure multiple accounts like so:
~/.ssh/config:
If I do a normal clone from github using git clone command, it will use my personal account. If I want to clone down using my work profile, it will be like so:
Problem:
When I use a devContainer, I setup ssh-forwarding so I can add keys and not have it stored into the container image. However, if I try the git clone using work account, it will not find the correct SSH key to use. I can confirm the keys are forwarded (using ssh-add -l). I could also try to create ~/.ssh/config and tell it to use a specific key -- but it will require a link to a private key file that doesn't exist inside the devContainer. Is there a way to link the IdentityFile to the key forwarded from ssh-forwarding? Or what other options do people do to work around this? Ideally I don't want to be having my private key stored/copied in multiple places on my system and containers.
Beta Was this translation helpful? Give feedback.
All reactions