Bird
0
0

You want to automate SSH key generation in a script without any prompts, saving the key as ~/.ssh/id_ed25519_custom. Which command correctly achieves this?

hard📝 Application Q15 of 15
Linux CLI - SSH and Remote Access
You want to automate SSH key generation in a script without any prompts, saving the key as ~/.ssh/id_ed25519_custom. Which command correctly achieves this?
Assh-keygen -t ed25519 -f ~/.ssh/id_ed25519_custom -N ''
Bssh-keygen -t ed25519 -f ~/.ssh/id_ed25519_custom
Cssh-keygen -t ed25519 -N ''
Dssh-keygen -t ed25519 -f ~/.ssh/id_ed25519_custom -y
Step-by-Step Solution
Solution:
  1. Step 1: Understand flags for silent key generation

    The -f flag sets the filename, and -N '' sets an empty passphrase to avoid prompts.
  2. Step 2: Check each option for automation suitability

    ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519_custom -N '' uses both -f and -N '' correctly. ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519_custom misses -N so it prompts for passphrase. ssh-keygen -t ed25519 -N '' misses filename, so default is used. ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519_custom -y uses -y which outputs public key but does not generate keys silently.
  3. Final Answer:

    ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519_custom -N '' -> Option A
  4. Quick Check:

    Use -f for file and -N '' for no passphrase = C [OK]
Quick Trick: Use -f for file and -N '' for no passphrase to avoid prompts [OK]
Common Mistakes:
  • Omitting -N '' causes passphrase prompt
  • Forgetting to specify filename with -f
  • Using -y which only outputs public key

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes