- Add the client users's ssh-rsa pubilic key to the server user's ~/.ssh/authorized_keys file.
The rest of the this will be done on the server as the user that will be logged in with the key and 2fa.
- Install the Google Authenticator PAM helper
sudo apt update && sudo apt upgrade -y - Always a good idea to update everything before starting
sudo apt install libpam-google-authenticator - This is the module for PAM which allows for 2fa via google