Add two-factor authentication to SSH (MFA/2FA) on Rocky Linux 9
What is MFA and why should we use it with SSH
Multifactor authentication (MFA) is a security process that requires more than one method of authentication from separate categories of authentication methods to verify the user's identity for a login or other transaction. In the case of SSH access, using MFA provides an additional layer of security to the authentication process by requiring the user's SSH key & possibly password and a code obtained using an authentication app. This makes it much more difficult for an attacker to gain unauthorized access to a system.
This guide will use the Google Authenticator package to combine Public-Key authentication with two-factor authentication. You will need the Google Authenticator app (or a compatible app) on your phone or mobile device.