You can follow these instructions in order to enable Google's 2-Step Authentication on your account when logging in using SSH.
![]() |
Login to your account using an SSH client (PuTTY, OpenSSH, etc).
Run google-authenticator
.
The first prompt will ask if you want your tokens to be time-based. We strongly recommend you say yes by entering y.
You will be given a URL and some emergency codes. Write them down somewhere safe, as this will be the only way to access your account if you lose your authenticator.
It will ask if you want to automatically update your .google_authenticator
file. You should say yes.
The following prompts vary depending on your preferences. If unsure, we recommend saying yes to all.
Go to the URL provided in step 4 and scan the QR code using the Google Authenticator app.
Done. SSH will now require a verification code from the Google Authenticator app on your mobile device.