Files
skel/dotfiles
David Tomaschik fa6a878487 Fix SSH agent forwarding clobbered by local agent in shenv (#14)
* Fix SSH agent forwarding clobbered by local agent in shenv

ssh/rc saves the raw forwarded socket in SSH_REMOTE_AUTH_SOCK before
rewriting SSH_AUTH_SOCK to the stable symlink. shenv was ignoring that
variable, so it saw SSH_AUTH_SOCK as "our link" and fell through to the
systemd lookup, which could overwrite the symlink with a local agent
socket and silently drop the forwarded one.

Now shenv checks SSH_REMOTE_AUTH_SOCK first, giving forwarded sockets
priority over any local agent.

https://claude.ai/code/session_01RhXaFzxJA5D2BcGcz18ipA

* Fix shenv clobbering forwarded SSH socket with local agent in tmux

ssh/rc env changes (including SSH_REMOTE_AUTH_SOCK) are lost because
ssh/rc runs as a sshd child process, not the user's shell. The shell
always receives SSH_AUTH_SOCK set to the raw forwarded socket path.

Fresh SSH login worked fine (step 1 catches the raw socket). The bug
was in tmux new windows: SSH_AUTH_SOCK there is our stable symlink, so
step 1 fails, then steps 2/3 look up the system agent and overwrite the
symlink that ssh/rc just set to the forwarded socket.

Fix: only run the system agent lookup when the stable symlink is already
broken. A valid symlink means ssh/rc (or a previous shenv run) already
set it correctly; don't clobber it.

https://claude.ai/code/session_01RhXaFzxJA5D2BcGcz18ipA

* Remove pointless exports from ssh/rc, add process-model comment

ssh/rc runs as a sshd child process so exports never reach the user's
shell. SSH_REMOTE_AUTH_SOCK was set and exported but never used (a
leftover from a prior failed fix attempt). SSH_AUTH_SOCK was reassigned
to the symlink path and exported, also to no effect. Remove both.

https://claude.ai/code/session_01RhXaFzxJA5D2BcGcz18ipA

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-04-18 19:20:43 -07:00
..
2026-04-09 18:03:14 -07:00
2026-02-21 10:58:05 -08:00
2026-04-14 10:27:17 -07:00
2019-08-13 14:35:23 -07:00
2016-04-11 00:58:05 -07:00
2026-02-12 15:52:10 -08:00
2026-03-24 19:26:53 +00:00
2026-04-02 16:37:51 -07:00
2025-06-11 15:36:29 -07:00
2026-02-20 15:18:10 -08:00
2022-10-20 11:04:27 -07:00
2018-06-13 14:26:44 -07:00
2019-04-11 15:56:55 +02:00
2019-09-02 21:30:11 -07:00
2019-09-23 13:31:03 -07:00
2026-02-20 15:56:04 -08:00
2026-02-25 16:56:18 -08:00
2018-07-06 15:52:20 +02:00
2026-02-10 07:51:28 -08:00
2016-04-11 00:58:05 -07:00
2024-05-09 13:19:17 -07:00
2022-12-29 20:37:22 -08:00
2026-02-15 16:45:06 -08:00
2025-05-01 14:05:16 -07:00
2024-10-29 16:45:11 -07:00
2023-10-05 11:48:21 -07:00
2019-04-27 20:17:04 -07:00
2026-02-25 20:31:28 -08:00
2020-04-20 14:53:04 -07:00
2026-02-18 16:10:06 -08:00
2022-05-23 21:56:45 -07:00
2019-04-11 16:01:03 +02:00
2026-02-18 16:10:06 -08:00
2018-02-09 13:33:03 -08:00
2026-02-18 16:10:06 -08:00
2026-03-21 16:23:32 -07:00
2026-04-01 14:02:33 -07:00
2026-04-09 21:18:24 -07:00