Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to connect to a remote server using SSH.
Bash Scripting
ssh [1]@example.com Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'password' instead of username in the SSH command.
Using 'localhost' which connects to the local machine, not remote.
✗ Incorrect
The SSH command requires the username before the @ symbol to connect to the remote server.
2fill in blank
mediumComplete the code to run a command remotely over SSH.
Bash Scripting
ssh user@example.com '[1]'
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'exit' which closes the SSH session instead of running a command.
Using 'cd /home' which changes directory but does not produce output.
✗ Incorrect
The command 'ls -l' lists files in long format on the remote server.
3fill in blank
hardFix the error in the SSH command to copy a file from local to remote.
Bash Scripting
scp [1] user@example.com:/home/user/ Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Adding user or host before the local file name causes errors.
Using a remote path as the source file.
✗ Incorrect
The local file name 'file.txt' should be specified without user or host prefix.
4fill in blank
hardFill both blanks to create an SSH key pair and copy the public key to the remote server.
Bash Scripting
ssh-keygen -t [1] -f ~/.ssh/id_[2] -N ''
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using outdated key types like 'dsa'.
Mismatching key type and file name.
✗ Incorrect
The modern recommended key type is 'ed25519', and the file name matches the key type.
5fill in blank
hardFill all three blanks to copy the SSH public key to the remote server for passwordless login.
Bash Scripting
cat ~/.ssh/id_[1].pub | ssh [2]@example.com 'mkdir -p ~/.ssh && cat >> ~/.ssh/[3]'
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong key file name.
Using wrong remote username.
Appending to wrong file instead of 'authorized_keys'.
✗ Incorrect
The public key file is 'id_ed25519.pub', the username is 'user', and the keys are appended to 'authorized_keys'.