Created 2015-08-27 by Hanz Makmur
In our ongoing effort to increase the security of our Linux accounts, beginning in Fall 2015, the CS Department is adding Google Authenticator as an optional service for users who want to increase the security of their Linux accounts on CS Linux machines. This is different from the 2FA set up for those using CS Password.
Google Authenticator is a system for time-based one-time passwords defined in RFC 6238. It is often used as part of a Two Factor Authentication for websites such as Google, GMail, FaceBook, DropBox, WordPress, LastPass, Amazon Cloud, and others where a user is required to put a 6 (or more) digit one-time verification token a long with username and password.
In general, for better security, you should enable Two-factor authentication wherever the service is provided. To learn more, check the Pixel Privacy Two-Factor Authentication explanation.
Requirement
Before you enable Google Authenticator, you will need to download the Google Authenticator App for your smartphones, tablets, or web browser. The App is available for Android and iOS devices, as well as for browser extensions such as Chrome Authenticator and Firefox Authenticator. You can also use your Duo App if you already installed one.
Activating Google Authenticator on CS Linux Machine.
Once you have a Google Authenticator App, you can now enable the Google Authenticator feature to enable two-factor authentication on CS Linux machines simply by typing: google-authenticator in a terminal window and answer 'y' on each question as below:
% google-authenticatorDo you want authentication tokens to be time-based (y/n) y https://www.google...@YOURHOSTNAME%3Fsecret%3DWYD4SYCGEE5N4M3LA Your new secret key is: WYD...GEYZ Your verification code is 16...Z Your emergency scratch codes are: 401..300 ... 00392542 Do you want me to update your "/path/homedir/.google_authenticator" file (y/n) y Do you want to disallow multiple uses of the same authentication token? This restricts you to one login about every 30s, but it increases your chances to notice or even prevent man-in-the-middle attacks (y/n) y By default, tokens are good for 30 seconds and in order to compensate for possible time-skew between the client and the server, we allow an extra token before and after the current time. If you experience problems with poor time synchronization, you can increase the window from its default size of 1:30min to about 4min. Do you want to do so (y/n) y If the computer that you are logging into isn't hardened against brute-force login attempts, you can enable rate-limiting for the authentication module. By default, this limits attackers to no more than 3 login attempts every 30s. Do you want to enable rate-limiting (y/n) y
This process generates a file named .google-authenticator in your home directory.
Note: If you are using XTerm, you should see QR codes on the screen as shown above.
At this time, you can use your Google Authenticator to scan the code on the screen or copy/paste the link into a browser to verify and complete the activation.
Testing Your Authenticator
To test your Google Authenticator, open a new SSH session and enter your username. The prompt will ask you for a verification code and then your password. Make sure you enter your Google Authenticator code when prompted. If you make a mistake, you have to do it all over again. The code can only be used once. Make sure you wait for a new verification code before you enter it.
Note: In an SSH session, the verification code is requested before your password; otherwise, it is requested after your password is entered.
Tips and Tricks
- If you would like to use just 1 authenticator code for all CS Linux Systems, you can copy the
.google-authenticatorfile to your home directory on each cluster. When Google Authenticator is enabled on the machine, it will automatically take effect. - If for some reason you need to turn off Google Authenticator, remove
.google-authenticatorfile, and it will no longer work.
For help with our systems or immediate assistance, visit the LCSR Operator at CoRE 235 or call 848-445-2443. Otherwise, see CS HelpDesk. Don’t forget to include your NetID along with a description of your problem.
Do you want authentication tokens to be time-based (y/n) y