102-350 · Question #105
What command is used to hold keys during a login session to be used for automatic authentication while logging in to other machines using ssh?
The correct answer is B. ssh-agent. See the full explanation below for the reasoning.
Question
Options
- Asshd
- Bssh-agent
- Cssh-keygen
- Dssh-add
How the community answered
(55 responses)- A9% (5)
- B85% (47)
- C2% (1)
- D4% (2)
Community Discussion
7The answer is B, ssh-agent. It runs as a background process during your login session and holds your decrypted private keys in memory, so you only have to type your passphrase once instead of every time you connect somewhere. The other options are close neighbors but serve different jobs: sshd is the server-side daemon that listens for incoming connections, ssh-keygen is the tool you use to create key pairs, and ssh-add is what you use to actually load a key into the agent after it is already running. Think of ssh-agent as the keychain holder, and ssh-add as the action of dropping a key into that holder.
ssh-agent is the daemon that runs in your login session, holds decrypted private keys in memory, and answers authentication challenges on your behalf so you never have to type your passphrase again for every hop. sshd is the server-side daemon listening for incoming connections, which is a common trap answer here. ssh-keygen generates the key pair, and ssh-add is what you use to load a key into the already-running agent, so both are necessary companions but neither one holds the keys during the session. The question is specifically about what holds and manages them, and that is ssh-agent. On my actual 102-350 sitting I almost second-guessed myself into picking ssh-add because I was thinking about the action of adding keys, but then I remembered that ssh-add just hands the key off to the agent and exits, it does not persist anything itself. The agent process is what stays alive for the duration of your session, bound to a socket that the SSH client queries whenever it needs to authenticate.
Just to add one small clarification, on most modern Linux distros systemd now auto-starts ssh-agent via a user socket so you may never explicitly launch it yourself, which trips people up when they try to troubleshoot why ssh-add works without them ever running eval $(ssh-agent) first.
Has to be A, sshd is the daemon that handles all SSH session authentication on the host.
Carlos, that is a reasonable instinct, but sshd handles authentication for incoming connections to the host, not outbound connections from it. For a client connecting out, it is the ssh-agent that manages key-based authentication by holding decrypted private keys in memory so you do not have to re-enter your passphrase.
A, sshd holds session auth keys, my deck has this cold.
Ingrid, the deck note is close but it trips on what sshd actually does. sshd handles the incoming connection and verifies credentials, but it is ssh-agent on the client side that holds and manages authentication keys for a session, which is why B is the one the exam is looking for here.