ssh-tpm-agent icon indicating copy to clipboard operation
ssh-tpm-agent copied to clipboard

Small improvement for usage example

Open c-kr opened this issue 6 months ago • 1 comments

Hi and thanks for this great tool,

i have a small improvement proposal for the first usage example in the README:

# Using the socket
$ ssh-tpm-agent -l /var/tmp/tpm.sock

$ export SSH_AUTH_SOCK="$(ssh-tpm-agent --print-socket)"

$ ssh [email protected]

I started the agent with ssh-tpm-agent -l /var/tmp/tpm.sock. This started the agent in the foreground more, not as daemon. So i changed to another terminal and ran export SSH_AUTH_SOCK="$(ssh-tpm-agent --print-socket)" an tried to ssh connect. But this failed because the agent could not read the environment variable from the agent in the other terminal, so the fallback (/run/user/1000/ssh-tpm-agent.sock) was used and the connect failed.

So to fix the documentation i recommend to either start the agent in background or remove -l /var/tmp/tpm.sock from the args to use the default also here.

c-kr avatar Jun 06 '25 18:06 c-kr

Honestly I wanted to mimic the behaviour of stock ssh-agent where you can daemonize the process and just get the env variables back. But I don't quite recall why i haven't implemented this.

Foxboron avatar Jun 06 '25 19:06 Foxboron