Now that you have logged in and set the root password, use hostname to find the hostname of the system. If needed, edit /etc/hostname and manually set your desired hostname. If you changed /etc/hostname, you must reboot the Raspberry Pi to make it take effect. This can be done by simply typing reboot at Command Prompt.
If your network is set up for DHCP connections, an IP address will have already been set for the board, and the Raspberry Pi will already be accessible through the hostname. If you don't have DHCP set up on your network, you will want to configure a static IP address for the Raspberry Pi and add the hostname and IP address to /etc/hosts on your host PC.
You can test the connection between your Host PC and the Raspberry Pi by issuing the following command on the host: $ ssh root@raspberrypi
Here, raspberrypi is the name of the device you found or configured previously.
If everything is correctly configured, you should be able to enter the root password and get Command Prompt on the Raspberry Pi.
The Yocto image we are using comes complete with a firewall. It is designed to help to make your Target more resistant to network-based attacks. But like many safety features (especially child-proof medicine bottles), the Target's firewall can get in the way. For the purposes of training, I suggest that you disable it and reboot your Target:
[On Target]$ update-rc.d firewall remove
[On Target]$ rm ./rcS.d/S60firewall
[On Target]$ reboot
If you want to avoid having to enter the root password with every connection to the Target, you can use ssh-copy-id to copy a unique key from your host PC to the Target. After doing this, ssh will try the key before asking for a password.
The format of the command is as follows:
[On Host] $ ssh-copy-id -f root@raspberrypi
If you don't have the ssh credentials on the host machine, the command will prompt you on how to create them. -f tells ssh-copy-id not to test whether the credentials already exist.
The Yocto image comes with a custom firewall rule that will lock login for 30 seconds after three failed login attempts. ssh-copy-id can trigger this.