Signing back into the Community for the first time? You'll need to reset your password to access your account. Find out more.
Forum Discussion
smfelsher
9 months agoOccasional Contributor
VSCode dev container and SSH
I am trying to use my SSH keys, which are stored in 1Password, in a dev container launched within VSCode.
Here is my ~/.ssh/config
```
Gitlab
Host gitlab.com
HostName gitlab.com ...
smfelsher
9 months agoOccasional Contributor
From man ssh
:
IdentityAgent
Specifies the Unix-domain socket used to communicate with the authentication agent.
This option overrides the SSH_AUTH_SOCK environment variable and can be used to select a specific agent. Setting the socket name to none disables the use of an authentication agent. If the string "SSH_AUTH_SOCK" is specified, the location of the socket will be read from the SSH_AUTH_SOCK environment variable. Otherwise if the specified value begins with a ‘$’ character, then it will be treated as an environment variable containing the location of the socket.
Arguments to IdentityAgent may use the tilde syntax to refer to a user's home directory, the tokens described in the “TOKENS” section and environment variables as described in the “ENVIRONMENT VARIABLES” section.
So, to make this work both locally and in a dev container:
1. export the SSH_AUTH_SOCK
in your shell's config file (.bashrc
, .zshrc
, etc.).
2. Use IdentifyAgent SSH_AUTH_SOCK
in the ~/.ssh/config
file