Skip to content

Broken after OpenSSH's commit: moved agent listener sockets from /tmp to ~/.ssh/agent #58

@Hisiste

Description

@Hisiste

First of all, thank you for your work! I've been using this tool for quite some time. :)

Now, after OpenSSH's commit openssh/openssh-portable@80162f9, the agent listener sockets were moved from /tmp to ~/.ssh/agent. Their reasoning is the following:

This ensures processes (such as Firefox) that have restricted filesystem access that includes /tmp (via unveil(3)) do not have the ability to use keys in an agent.

Fortunately, the -T flag on the ssh-agent command will return to placing the agent socket into the /tmp directory.

# ~/.bashrc or ~/.zshrc
ssh-add -l >&/dev/null || ssh-find-agent -a || eval $(ssh-agent -T) > /dev/null

Is updating this tool to consider the ~/.ssh/agent directory a good idea? Unfortunately, the name of the socket file does not appear to have the PID of the SSH agent in it anymore. It only appears to have a randomized string. E.g.:

$ eval $(ssh-agent)
Agent pid 11434

$ echo "$SSH_AUTH_SOCK"
/home/<user>/.ssh/agent/s.<hash_of_hostname>.agent.AzSubDP0S1

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions