SSH Forwarding In DevContainer #224
Replies: 1 comment
-
I assume your dockerfile is using a variant of linux. I'm on Windows 11, and I can load up a docker image pretty simple w/ SSH forwarding. You may want to read up on it here: One thing I remember pulling my hair out was regarding you may need to upgrade your SSH on windows. Please refer to this article (https://github.com/PowerShell/Win32-OpenSSH/wiki/Install-Win32-OpenSSH) on upgrading it... I was really shocked I needed to do this to fix my SSH. Once I did, everything just worked! In a nutshell, this is my workflow now a days:
ssh-add -l You should see something like this: 4096 SHA256:uuQ6KgGac+n+SwNjapiFtHQ2IOpwFG2VwfniXXXXXXX (RSA) If you're using github, you can use this to confirm access: ssh -T git@github.com It should say something like this: Hi hinate13! You've successfully authenticated, but GitHub does not provide shell access. Hope that helps! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm hoping someone can help me on this, I am looking to setup SSH forwarding in the most simplest way imaginable, I've consulted many places where there is a brief outline and a description, but alas, none seem to work.
This is my
devcontainer.json
:What do we have to do simply to get everything working together nicely on this? I have tried:
1. Standard SSH-Agent Forwarding via Dev Containers Feature
ssh-add --apple-use-keychain ~/.ssh/id_ed25519
~/.ssh/config
with2. Manual Agent-Socket Bind via
mounts
+containerEnv
eval "$(ssh-agent -s)"
+ssh-add ~/.ssh/id_ed25519
/ssh-agent
socket present in container butssh-add -l
shows no identities3. Manual Agent-Socket Bind via
runArgs
4. GUI vs. Terminal VS Code Launch Debug
code .
in terminalterminal.integrated.inheritEnv
$SSH_AUTH_SOCK
, container still empty5. macOS Keychain + Config Tweak
ssh-add --apple-use-keychain ~/.ssh/id_ed25519
~/.ssh/config
snippet as in https://github.com/nikepupu/language_grounding_cad120/pull/1#issue-1414123952 #16. Full
~/.ssh
Directory Bind-Mount (No Agent)chmod 700 ~/.ssh
+chmod 600 ~/.ssh/id_ed25519
At this point I'm tearing my hair out with this for something that should be so simple.
Beta Was this translation helpful? Give feedback.
All reactions