SSH is one of the most popular ways to control your Raspberry Pi from your laptop or PC. Here you’ll learn how to set up two-factor authentication for your SSH access to Raspberry Pi and add an extra layer of security to it.
Note: If you are using SSH key-file to access your Raspberry Pi, the two-factor authentication won’t be in use.
Update your Pi
Assuming you have already set up your Raspberry Pi with Raspberry Pi OS, it’s best to first check that all your software is up to date. Open a terminal and type the following command:
Enable SSH
Raspberry Pi OS has the SSH server disabled by default. Before you can connect to your Pi via SSH, you need to enable it by running the following Terminal commands: