Challenge - 5 Problems
SSH Key Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
What is the output of this ssh-keygen command?
You run the command
ssh-keygen -t rsa -b 2048 -f ~/.ssh/id_rsa_test -N "". What is the expected output?Linux CLI
ssh-keygen -t rsa -b 2048 -f ~/.ssh/id_rsa_test -N ""
Attempts:
2 left
💡 Hint
Think about what ssh-keygen does when creating a key pair with no passphrase.
✗ Incorrect
The ssh-keygen command generates a new RSA key pair with 2048 bits, saves it to the specified file, and outputs the fingerprint and randomart image. The other options are error messages unrelated to this command.
💻 Command Output
intermediate2:00remaining
What is the output of this ssh-copy-id command?
You run
ssh-copy-id -i ~/.ssh/id_rsa_test.pub user@remotehost. What output do you expect if the key is successfully copied?Linux CLI
ssh-copy-id -i ~/.ssh/id_rsa_test.pub user@remotehost
Attempts:
2 left
💡 Hint
This command copies your public key to the remote server's authorized keys.
✗ Incorrect
ssh-copy-id copies the public key to the remote user's authorized_keys file and confirms the number of keys added. Other options are errors or permission issues.
🔧 Debug
advanced2:30remaining
Why does this SSH login fail with 'Permission denied (publickey)'?
You try to ssh into a server using key-based authentication but get this error:
Permission denied (publickey). The public key is correctly in ~/.ssh/authorized_keys. What is the most likely cause?Linux CLI
ssh user@remotehost
Attempts:
2 left
💡 Hint
Check file and directory permissions on the server for SSH keys.
✗ Incorrect
SSH requires strict permissions on ~/.ssh and authorized_keys (usually 700 for ~/.ssh and 600 for authorized_keys). Too open permissions cause SSH to reject keys for security.
🚀 Application
advanced2:30remaining
Which command sets up an SSH agent and adds your private key for authentication?
You want to avoid typing your SSH key passphrase repeatedly. Which command sequence correctly starts the SSH agent and adds your private key?
Attempts:
2 left
💡 Hint
The ssh-agent must be started in the current shell environment.
✗ Incorrect
The correct way is to evaluate the output of ssh-agent to set environment variables, then add the key with ssh-add. Other options either use invalid commands or do not set environment variables properly.
🧠 Conceptual
expert3:00remaining
What is the main security advantage of using SSH key-based authentication over password authentication?
Choose the best explanation for why SSH key-based authentication is more secure than password authentication.
Attempts:
2 left
💡 Hint
Think about how the private key is used during authentication.
✗ Incorrect
SSH key authentication uses a private key stored only on the client and a public key on the server. The private key is never sent over the network, preventing interception. Passwords are sent (even if encrypted) and can be guessed or phished.