1Z0-100 · Question #105
Which two statements are true regarding the use of the ssh-agent and ssh-add commands?
The correct answer is A. The ssh-agent is used to hold private keys. D. The ssh-add command asks for the passphrase only the first time a key is required by the same. A (not C): If you want to omit passphrase and password entry when you are using Solaris Secure Shell, you can use the agent daemon. Use the ssh-agent command at the beginning of the session. Then, store your private keys with the agent by using the ssh-add command. D: Add your…
Question
Which two statements are true regarding the use of the ssh-agent and ssh-add commands?
Options
- AThe ssh-agent is used to hold private keys.
- BThe ssh-add command may ask for a passphrase each time the same key is required by the
- CThe ssh-agent is used to hold only public keys.
- DThe ssh-add command asks for the passphrase only the first time a key is required by the same
- EThe ssh-add command retries the most recently saved passphrase if multiple key files are used.
How the community answered
(34 responses)- A82% (28)
- B6% (2)
- C9% (3)
- E3% (1)
Explanation
A (not C): If you want to omit passphrase and password entry when you are using Solaris Secure Shell, you can use the agent daemon. Use the ssh-agent command at the beginning of the session. Then, store your private keys with the agent by using the ssh-add command. D: Add your private key to the agent daemon. The ssh-add command adds your private key to the agent daemon so that subsequent Secure Shell activity does not prompt you for the passphrase. myLocalHost% ssh-add Enter passphrase for /home/johndoe/.ssh/id_rsa: Identity added: /home/johndoe/.ssh/id_rsa(/home/johndoe/.ssh/id_rsa) myLocalHost%
Topics
Community Discussion
5A and D are your correct answers here. ssh-agent is a background process that caches your decrypted private keys in memory, so option A is right and C is obviously wrong. The whole point of using it is that you only type your passphrase once per session. That is exactly what D captures: ssh-add loads the key into the agent and prompts for the passphrase that one time, then any subsequent SSH connection that needs that key just pulls it from the agent silently. B is wrong because it describes the behavior you would have without ssh-agent at all, which defeats the purpose of using it in the first place.
I initially picked A and B because I assumed ssh-add kept prompting you, but then I spun up a quick lab and loaded a key with ssh-add, and sure enough it only asked for the passphrase once and then the agent just handled everything after that. So A and D are the winners here, the agent holds your private keys and ssh-add only bugs you for the passphrase that first time.
So ssh-agent stores the private key in memory, but how long does it actually hold it before you need to re-add?
A and E, saw that exact passphrase retry behavior tested on mine.
Hey Toby, it is actually A and D on that one. E covers the retry lockout behavior you are thinking of, but D is what the objective tests directly for the passphrase enforcement mechanism itself.