0

I can ssh into this machine ssh user@remote_machine.com and it always works. However I discovered that ssh-add -l shows no key (I had to replace my laptop a month ago). Does it mean that the ssh tool doesn't use the ssh agent?

What is the agent used for then?

2

ssh by default will check for certain identity files, for example ~/.ssh/id_rsa. However, you can specify alternative identity files with -i. See man ssh for details.

ssh-agent helps manage identity files:

From man ssh-agent:

Multiple identities may be stored in ssh-agent concurrently and ssh(1)
will automatically use them if present.

One benefit of using ssh-agent is that if your private key is password-protected (recommended), you can unlock it once when adding it to your ssh-agent and you won't need to re-enter the password every time you use it.

Other benefits include agent forwarding. See man ssh for details.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.