Killing ssh-agent deletes socketfile on one debian, on another debian it remains

85 Views Asked by At

I faced a strange problem.

Give: 2 Debian 12, same updates done.

When i create a ssh-agent with ssh-agent -a ~/.ssh/my-agent -t 7200 i get a ssh-agent process and a socketfile ~/.ssh/my-agent

then i delete the socket-file manually.

Next step, i create with the same command above another ssh-agent with the same socketfile.

I get 2 ssh-agent-processes (i can see them with ps) and a new socket-file.

Killing the older process removes the socketfile on one computer, and the socketfile remains on killing the older process on the other computer.

And i found nothing in documentation, where i can do some general-settings for that behaviour.

Now: On the first computer i kill the older agent with kill <pid>. Result: The older process is killed, the socketfile still exists, because it belongs to the newer agent.

On the other computer i did the same. Kill the older process with it's pid. Result: The older process is killed, the socketfile is also removed. Even though the owner is the newer agent-process. I can prove this with strace and adding an identity to the newer process, which of this two processes reacts on adding (or removing) identities.

For proving which process listens on the socket-file i opened two terminal and started strace with sudo strace -p <pid>. One for the older, one for the younger process.

And i have no idea, why on one debian the socket-files is removed on the other debian the socketfile is NOT removed.

0

There are 0 best solutions below