Key-based authentication

Using a public-private key pair for authenticating a client to an SSH server (Raspberry Pi), we can secure our Raspberry Pi from hackers. To enable key-based authentication, we first need to generate a public-private key pair using tools called PuTTYgen for Windows and ssh-keygen for Linux. Note that a key pair should be generated by the client and not by Raspberry Pi. For our purpose, we will use PuTTYgen for generating the key pair. Download PuTTY from the following web link:

Note that puTTYgen comes with PuTTY, so you need not install it separately.

Open the puTTYgen client and click on Generate, as shown in Figure 10.9:

Figure 10.9

Next, we need to hover the mouse over the blank area to ...

Get Internet of Things with Raspberry Pi 3 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.