Using Two-Factor Authentication
2 minute read.Last Modified 2023-11-17 11:50 EST
We recommend two-factor authentication (2FA) for increased security. TrueNAS offers 2FA to ensure that a compromised administrator (root) password alone cannot grant access to the administrator interface. To utilize 2FA, you need a mobile device with Google Authenticator installed. Other authenticator applications can be used, but you will need to confirm the settings and QR codes generated in TrueNAS are compatible with your particular app before permanently activating 2FA.
Two-factor authentication (2FA) is an extra layer of security that prevents someone from logging in, even if they have your password. This extra security measure requires you to verify your identity using a randomized 6-digit code that regenerates every 30 seconds (unless modified).
Set up a second 2FA device as a backup before proceeding.
Go to System > 2FA and click ENABLE TWO-FACTOR AUTHENTICATION. Then, click CONFIRM.
Click SHOW QR, then scan it using Google Authenticator on the mobile device.
Enabling 2FA changes the login process for both the TrueNAS web interface and SSH logins:
The login screen has another field for the randomized authenticator code. If this field isn’t immediately visible, refresh the browser.
Enter the code from the mobile device (complete without the space) in the login window with the root username and password.
Set Enable Two-Factor Auth for SSH in System > 2FA, then go to Services > SSH and click .
Set Log in as Root with Password and click SAVE. Toggle the SSH service and wait for the status to show that it is RUNNING.
Open a Command Prompt or Terminal and SSH into TrueNAS using the system hostname or IP address, root account username and password, and the 2FA code from the mobile device.