Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create and maintain custom symbolic link to a recent, valid SSH_AUTH_SOCK #13

Open
whisperity opened this issue Dec 11, 2022 · 0 comments
Labels
Platform: Unix 🐧 Related to Unix/Linux-specifics Target: Communication protocol 💬⚠️ A part of the core library which deals with client-server messaging Target: Core 💥 Core architectural support library Target: Reference implementation 📃 The "official" Client & Server implementations

Comments

@whisperity
Copy link
Owner

Trivially implements #12 in practice.

Note: Idea taken from byobu.

A common problem occurs over elongated uses of Monomux where the user forwards the SSH Agent and starts a session with the environment in one forwarded connection (SSH_AUTH_SOCK=/tmp/sshd-..../agent). When the connection terminates, the Agent socket is deleted, but the running session still points to it. The next connection just attaches to the session and tries to use the invalidated agent.

At least for the common case of SSH (luckily the Agent is a socket file that we can symlink and such...) we should create a path which we inject as SSH_AUTH_SOCK into the spawned sessions. Every time a client attaches to the server successfully, we should ask the client what its SSH_AUTH_SOCK is, and during the connection process, set the symlink to this path.

This way, the sessions will always see the latest attached client's SSH Agent, which might not be the best solution if multiple connections exist in parallel, but still somewhat better than only the first connection working...

@whisperity whisperity added Target: Core 💥 Core architectural support library Target: Reference implementation 📃 The "official" Client & Server implementations Platform: Unix 🐧 Related to Unix/Linux-specifics Target: Communication protocol 💬⚠️ A part of the core library which deals with client-server messaging labels Dec 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Platform: Unix 🐧 Related to Unix/Linux-specifics Target: Communication protocol 💬⚠️ A part of the core library which deals with client-server messaging Target: Core 💥 Core architectural support library Target: Reference implementation 📃 The "official" Client & Server implementations
Projects
None yet
Development

No branches or pull requests

1 participant