0
0
Linux CLIscripting~20 mins

SSH connection basics in Linux CLI - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
SSH Connection Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
2:00remaining
What is the output of this SSH command?
You run the command ssh -v user@192.168.1.10 to connect to a server. Which of the following lines will you see in the verbose output indicating a successful key exchange?
Linux CLI
ssh -v user@192.168.1.10
APermission denied (password).
Bdebug1: Authentication succeeded (publickey).
Cssh: Could not resolve hostname 192.168.1.10: Name or service not known
DConnection timed out during banner exchange
Attempts:
2 left
💡 Hint
Look for messages that confirm authentication success in verbose SSH output.
🧠 Conceptual
intermediate
1:30remaining
Which SSH option disables strict host key checking?
You want to connect to a new SSH server without being prompted to confirm the server's fingerprint. Which SSH option disables this prompt?
A-o PasswordAuthentication=no
B-o UserKnownHostsFile=/dev/null
C-o StrictHostKeyChecking=no
D-o ConnectTimeout=5
Attempts:
2 left
💡 Hint
This option controls whether SSH asks to confirm the server's fingerprint.
🔧 Debug
advanced
2:00remaining
Why does this SSH command fail with 'Permission denied'?
You run ssh user@host but get Permission denied (publickey,password). error. Which of the following is the most likely cause?
AThe SSH server does not allow password authentication and your public key is not set up.
BThe SSH client is using the wrong port number.
CThe SSH server is down and unreachable.
DThe username is misspelled in the command.
Attempts:
2 left
💡 Hint
Consider what authentication methods the server accepts and what keys you have.
🚀 Application
advanced
2:00remaining
How to copy a file securely using SSH?
You want to copy a file named report.txt from your local machine to the remote server server.example.com under the directory /home/user/docs. Which command correctly does this?
Ascp report.txt user@server.example.com:/home/user/docs/
Bssh user@server.example.com cp report.txt /home/user/docs/
Cssh-copy-id report.txt user@server.example.com:/home/user/docs/
Drsync report.txt user@server.example.com:/home/user/docs/
Attempts:
2 left
💡 Hint
Think about which command is designed to copy files over SSH.
💻 Command Output
expert
2:30remaining
What is the output of this SSH command with a custom port?
You run ssh -p 2222 user@host but get the error message. Which option shows the exact error you will see if port 2222 is closed on the server?
Linux CLI
ssh -p 2222 user@host
AConnection timed out during banner exchange
Bssh: Could not resolve hostname host: Name or service not known
CPermission denied (publickey).
Dssh: connect to host host port 2222: Connection refused
Attempts:
2 left
💡 Hint
Think about what happens when the port is closed but the host is reachable.