Complete the code to connect to a Raspberry Pi using SSH.
ssh [1]@192.168.1.10
The default username for Raspberry Pi is pi. So the SSH command should use pi@192.168.1.10 to connect.
Complete the command to specify a custom SSH port 2222 when connecting.
ssh -p [1] pi@192.168.1.10
The -p option in SSH specifies the port number. Here, the custom port is 2222.
Fix the error in the SSH command to copy a file to the Raspberry Pi.
scp myfile.txt [1]192.168.1.10:/home/pi/
The correct syntax for SCP requires the username followed by @ before the IP address, like pi@192.168.1.10.
Fill in the blank to create a dictionary comprehension that maps hostnames to their IPs if the IP starts with '192'.
hosts = {name: ip for name, ip in devices.items() if ip.[1]('192')}The startswith method checks if the IP string begins with '192'.
Fill all three blanks to create a dictionary comprehension that maps usernames to their home directories if the directory path contains '/home'.
user_dirs = { [1] : [2] for [1], [2] in [3].items() if '/home' in [2] }The comprehension iterates over users.items() with user and directory as key and value. The condition checks if '/home' is in the directory path.