0
0
Raspberry Piprogramming~10 mins

Securing Raspberry Pi (SSH keys, firewall) - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to generate an SSH key pair on Raspberry Pi.

Raspberry Pi
ssh-keygen -t [1] -b 2048 -f ~/.ssh/id_rsa
Drag options to blanks, or click blank then click option'
Aecdsa
Bdsa
Crsa
Ded25519
Attempts:
3 left
💡 Hint
Common Mistakes
Using unsupported or less common key types like dsa.
2fill in blank
medium

Complete the command to copy your SSH public key to the Raspberry Pi for passwordless login.

Raspberry Pi
ssh-copy-id [1]@raspberrypi.local
Drag options to blanks, or click blank then click option'
Api
Broot
Cadmin
Duser
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'root' or other usernames that may not exist.
3fill in blank
hard

Fix the error in the command to enable the UFW firewall on Raspberry Pi.

Raspberry Pi
sudo ufw [1]
Drag options to blanks, or click blank then click option'
Aon
Bactivate
Cstart
Denable
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'start' or 'activate' which are not valid UFW commands.
4fill in blank
hard

Fill both blanks to allow SSH and deny all other incoming connections using UFW.

Raspberry Pi
sudo ufw [1] ssh
sudo ufw [2] incoming
Drag options to blanks, or click blank then click option'
Aallow
Bdeny
Cblock
Dreject
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'block' or 'reject' which behave differently than 'deny'.
5fill in blank
hard

Fill all three blanks to disable password authentication and root login in SSH config.

Raspberry Pi
sudo sed -i 's/[1] yes/[2] no/' /etc/ssh/sshd_config
sudo sed -i 's/[3] yes/[2] no/' /etc/ssh/sshd_config
sudo systemctl restart sshd
Drag options to blanks, or click blank then click option'
APermitRootLogin
Bno
CPasswordAuthentication
Dyes
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up the config options or using 'yes' instead of 'no'.