dlech / KeeAgent

ssh agent plugin for KeePass 2.x
http://lechnology.com/software/keeagent
Other
530 stars 35 forks source link

Feature Request: "Client Mode" socket path option #302

Open NP-Hardass opened 4 years ago

NP-Hardass commented 4 years ago

Currently, there is a field for "Agent mode socket file." (henceforth referred to as "socketPath") Immediately following that is a comment: "To use, set the SSH_AUTH_SOCK environment variable to this path." Current behavior is that "Client Mode" uses $SSH_AUTH_SOCK and "Agent Mode" uses socketPath.

I'd like to recommend a change in behavior for socketPath. When the socketPath is non-empty, use socket_path instead of the env var SSH_AUTH_SOCK. If socketPath is defined as the special value "SSH_AUTH_SOCK" or undefined, use the env variable SSH_AUTH_SOCK.

When in "Agent Mode," a change in socketPath causes creation of a new socket. In "Client Mode," a change in socketPath causes an immediate new connection to the newly specified socket.

This will allow usage of sockets to be a little more dynamic. The reason behind this proposal is that if the ssh agent in "Client Mode" dies, the SSH_AUTH_SOCK variable is no longer pointing at a valid socket. Instantiating certain ssh agents like ssh-agent creates a random socket path, meaning continuation of KeeAgent usage requires closing and re-opening KeePass. After this change, death of the ssh agent and subsequent of change in the location of new SSH_AUTH_SOCKET, KeeAgent would gracefully update when the user updates the socketPath without requiring restarting the whole password manager.

Thanks for the awesome software. And hope you are able to add this new feature.