You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore(local-mounts): 🔧 update SSH agent detection and improve README
- enhance SSH agent forwarding with runtime detection
- update README with clearer instructions and features
- bump version to 1.0.7 in devcontainer-feature.json
|`SSH_AUTH_SOCK`|*(set at runtime via `/etc/profile.d/`)*| SSH agent socket — detected with fallback chain|
97
131
|`GPG_TTY`|`/dev/pts/0`| GPG tty for signing |
98
132
99
133
## How It Works
@@ -145,24 +179,28 @@ ls -la ~/.gitconfig
145
179
git config --global user.name # Should show your name
146
180
```
147
181
148
-
### SSH keys not working
182
+
### SSH agent not forwarded (Permission denied)
149
183
150
-
1. Ensure SSH agent is running on host:
151
-
```bash
152
-
ssh-add -l # Should list your keys
153
-
```
184
+
If `git fetch` or `ssh -T git@github.com` fails with `Permission denied (publickey)`:
154
185
155
-
2. Prefer a stable socket path on host:
186
+
1. Check the socket inside the container:
156
187
```bash
157
-
export SSH_AUTH_SOCK="$HOME/.ssh/agent.sock"
188
+
echo"$SSH_AUTH_SOCK"
189
+
test -S "$SSH_AUTH_SOCK"&&echo"OK"||echo"MISSING"
190
+
ssh-add -l
158
191
```
159
192
160
-
3. Inside container, verify:
193
+
2. If the socket is missing, check VS Code's native forwarding on the host:
161
194
```bash
162
-
env | grep SSH_AUTH_SOCK
163
-
ssh-add -l # Should work
195
+
# On host
196
+
ssh-add -l # Must show keys
197
+
echo "$SSH_AUTH_SOCK" # Must point to a valid socket
164
198
```
165
199
200
+
3. Optionally configure a stable socket on the host (see SSH section above).
201
+
202
+
4. Rebuild the container after fixing the host configuration.
203
+
166
204
### GPG keys not found
167
205
168
206
1. Verify GPG is set up locally:
@@ -188,7 +226,8 @@ The `install.sh` script verifies all mounts and provides clear feedback on what'
188
226
189
227
## Version History
190
228
191
-
- **v1.0.5**: Removed fragile direct `$SSH_AUTH_SOCK` bind mount and switched to stable `~/.ssh/agent.sock` strategy
229
+
- **v1.0.7**: Replaced static `containerEnv` SSH_AUTH_SOCK with runtime detection via `/etc/profile.d/` — preserves VS Code native forwarding as fallback
192
230
- **v1.0.6**: Added `username` option with mount staging (`/tmp/local-mounts`) and sync to `/home/<username>`
231
+
- **v1.0.5**: Removed fragile direct `$SSH_AUTH_SOCK`bind mount and switched to stable `~/.ssh/agent.sock` strategy
193
232
- **v1.0.4**: Fixed `.npmrc` mounting with robust fallback verification
Copy file name to clipboardExpand all lines: src/local-mounts/devcontainer-feature.json
+3-4Lines changed: 3 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
1
{
2
2
"id": "local-mounts",
3
-
"version": "1.0.6",
3
+
"version": "1.0.7",
4
4
"name": "Local Development Files Mount",
5
-
"description": "Mounts local Git, SSH, GPG, and npm configuration files into the devcontainer with support for custom usernames. Uses a stable SSH socket strategy to avoid dynamic bind-mount failures.",
5
+
"description": "Mounts local Git, SSH, GPG, and npm configuration files into the devcontainer with support for custom usernames. Uses runtime SSH agent detection with fallback to VS Code native forwarding.",
0 commit comments