Two-factor authentication means that in addition to a password, you need a key (typically a numeric PIN) generated by a device you have with you. Most people install an app on their cell phone to generate the key. Two-factor authentication can increase your security, although it's not a magic solution to all problems. See the next section for what it can and can't do.
On our systems, individual users can enable two-factor authentication for their accounts. Once that's done, all logins using that username will need the extra key. (There's an exception for cron jobs, but you have to enable that exception on a host-by-host basis.)
Our Kerberos implementation supports three forms of two-factor authentication: TOTP, HOTP, and Yubikey. In addition, Google authenticator can be used, as in the past. (However we've had issues with the Google authenticator code. We may well not continue with it. If you're using Google authenticator, we suggest changing to the two-factor authentication described here.)
TOTP and HOTP both work with an application on your phone or other device. The application displays a 6-digit number, which you need to add at the end of your password to login.
TOTP and HOTP use slightly different algorithms. TOTP is based on the time. The same code works for about 30 sec. HOTP is based on count. That is, the next number applies no matter when you use it. That means you can generate numbers from HOTP and keep them in your wallet. With TOTP you need your phone with you to login.
There are things to think about before using two-factor authentication. See the section at the end.
For more detailed documentation, see the Redhat one-time password documentation.
What Two-Factor Authentication Will and Won't Protect Against
Two-factor authentication primarily protects against people guessing or finding out your password. In practice this is the most common type of security problem at Rutgers. It includes things such as brute-force attempts to try common passwords, various software that can watch your interactions with the system, and someone seeing you type your password.
Historically, hackers have often found ways to become "root" (the privileged user). Once they can do that, they can install software to watch what you do. There are relatively recent attacks that allow even normal users to do that. If someone is able to watch what you do, they can get your password. Using a one-time password means that they won't be able to login as you in the future.
However one-time passwords don't protect you while you're logged in. If someone is able to become root on a system, they can access your files while you're logged in. They can also watch what you're doing. One-time passwords simply limit your exposure by making sure they can't login as you later and continue accessing your files.
For this reason, If you have sensitive material, it is best to limit your logins to systems used by only a few people. This is one reason we maintain two systems that only faculty can log in to. (Note however that legally sensitive material, such as SSNs and medical information, should not be kept on our systems without special security arrangements.)
Mobile Device Clients
Clients for TOTP and HOTP are available for many devices. For IOS and Android, we recommend FreeOTP for full compatibility in the appropriate app store.
Because the TOTP and HOTP standards are also used by Google authenticator, you can also use a Google authenticator implementation on your device with some limitation (see Important note below). For devices other than IOS and Android, we recommend looking for a Google authenticator implementation (see Important note below). If you're using DUO for your University account, the DUO app can generate one-time passwords for our system. (We do not use the actual DUO technology. It's just that their app supports standards-based authenticatoin as well as their own technology.)
Enabling Two-factor Authentication
Two-factor authentication uses "tokens." For TOTP and HOTP, a token is simply an item that shows in your mobile app. The same mobile app can have tokens for many different systems. You can also have more than one token for a system, e.g. one for TOTP and one for HOTP.
To enable two-factor authentication, log into one of our systems. To add a TOTP token, type
ipa otptoken-add (if you're using FreeOTP, DUO, Lastpass Authenticator, 1Password, or Sophos Authenticator)This command will display a QR code. In the phone app, hit the QR icon and use the camera to scan the QR code displayed. This uses TOTP. To add a HOTP token, use
ipa otptoken-add --algo=sha1 (for other clients)
ipa otptoken-add --type=hotpIf you are concerned about brute-force attempts to guess your password, it is somewhat safer to use --digits=8 with the otptoke-add command. The default is to generate a 6-digit random PIN.
Yubikey is a physical device that you carry with you and plug into a USB port. If you have a Yubikey, you can use it with our system. Insert your key, and then type the command
If you use Yubikey, we recommend also using the other type of OTP, since Yubikey won't let you ssh from a non-CS system such as your home computer, unless you're done special software setup to integrate it with our system.
USING THE CLIENT
FreeOTP on your mobile device will display a 6-digit code. To login, type your normal password, adding the 6 digits to the end.
If you're worried about forgetting or losing your phone, one approach is to add both HOTP and TOTP. Generate several keys using HOTP and keep them in your wallet. Then use TOTP for normal use. If you lose your phone, you can login with the keys from your wallet until you can replace it or remove two-factor authentication. (Use "ipa otptoken-find" to list your tokens, and "ipa otptoken-del UNIQUEID" to remove one.)
You can also set up two-factor on more than one portable device, e.g. your phone and a tablet.