0
0
Raspberry Piprogramming~20 mins

Remote access with SSH in Raspberry Pi - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
SSH Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Predict Output
intermediate
2:00remaining
What is the output of this SSH command?
You run this command on your local machine to connect to a Raspberry Pi with IP 192.168.1.10 as user 'pi'. What will be the output if the connection is successful?
Raspberry Pi
ssh pi@192.168.1.10
Api@192.168.1.10's password:
BPermission denied, please try again.
Cssh: Could not resolve hostname 192.168.1.10: Name or service not known
DConnection timed out during banner exchange
Attempts:
2 left
💡 Hint
Think about what happens right after you run ssh with a correct IP and username.
Predict Output
intermediate
2:00remaining
What error occurs when SSH server is not running?
You try to connect to your Raspberry Pi with SSH but the SSH server is not running. What error message will you see?
Raspberry Pi
ssh pi@192.168.1.10
AConnection timed out during banner exchange
BPermission denied (publickey,password).
Cssh: Could not resolve hostname 192.168.1.10: Name or service not known
Dssh: connect to host 192.168.1.10 port 22: Connection refused
Attempts:
2 left
💡 Hint
If the server is off or not listening on port 22, the connection is refused.
🔧 Debug
advanced
2:00remaining
Why does this SSH command fail with 'Permission denied'?
You run this command to connect to your Raspberry Pi but get 'Permission denied' error. What is the most likely cause?
Raspberry Pi
ssh pi@192.168.1.10
# You enter the wrong password multiple times.
AThe Raspberry Pi IP address is incorrect.
BYou typed the wrong password or the user 'pi' does not have SSH access.
CThe SSH server is not running on the Raspberry Pi.
DYour local machine's SSH client is outdated.
Attempts:
2 left
💡 Hint
Permission denied usually means authentication failed.
🧠 Conceptual
advanced
2:00remaining
What is the purpose of SSH key pairs in remote access?
Why do we use SSH key pairs instead of passwords for connecting to a Raspberry Pi remotely?
ASSH keys replace the need for an IP address when connecting.
BSSH keys slow down the connection but increase compatibility.
CSSH keys allow passwordless, more secure authentication without sending passwords over the network.
DSSH keys are used only for encrypting files on the Raspberry Pi.
Attempts:
2 left
💡 Hint
Think about security and convenience in remote login.
Predict Output
expert
2:00remaining
What is the output of this SSH command with port forwarding?
You run this command to forward your local port 8080 to Raspberry Pi's port 80. What will be the output if successful?
Raspberry Pi
ssh -L 8080:localhost:80 pi@192.168.1.10
Api@192.168.1.10's password:
BWarning: Remote port forwarding failed.
Cssh: connect to host 192.168.1.10 port 22: Connection timed out
DLocal forwarding failed: Address already in use
Attempts:
2 left
💡 Hint
Port forwarding does not change the initial password prompt.