Usare l’autenticazione a due fattori

L’autenticazione a due fattori (2FA) è un modo per proteggere il tuo account Nextcloud contro accessi non autorizzati. Esso funziona richiedendo due diverse “prove” della tua identità. Per esempio, qualcosa che tu sai (come una password) e qualcosa che hai come una chiave fisica. Tipicamente, il primo fattore è una password che già possiedi e il secondo può essere un testo di messaggio che ricevi o un codice che generi sul tuo cellulare o su un altro dispositivo (qualcosa che hai). Nextcloud consente una varietà di secondi fattori e altri possono essere aggiunti.

Once a two-factor authentication app has been enabled by your administrator, you can enable and configure it in Impostare le proprie preferenze.

Configurare l’autenticazione a due fattori

In your personal settings, look up the Second-factor Auth setting. In this example this is TOTP, a Google Authenticator compatible time-based code:

Configurazione TOTP.

Potrai vedere il tuo codice segreto e un codice QR che può essere acquisito dall’applicazione TOTP sul tuo cellulare (o un altro dispositivo). A seconda dell’applicazione o dello strumento, inserisci il codice o acquisisce il QR e il tuo dispositivo mostrerà un codice di accesso che cambia ogni 30 secondi.

Recovery codes if you lose your second factor

You should always generate backup codes for 2FA. If your second factor device gets stolen or stops working, you can use one of these codes to unlock your account. It effectively functions as a backup second factor. To get the backup codes, go to your personal settings and look under Second-factor Auth settings. Choose Generate backup codes:

Generatore di codice di backup 2FA

You will then see a list of one-time-use backup codes:

Codici di backup 2FA

Store these codes somewhere safe where you can find them. Do not keep them with your second factor (such as your mobile phone), but store them separately so that losing one does not mean losing the other.

Accesso con l’autenticazione a due fattori

After you log out and log in again, you will see a prompt to enter the TOTP code in your browser. If you have enabled more than one second factor, you will see a selection screen where you can choose which method to use for this login. Select TOTP:

Scelta di un metodo di autenticazione a due fattori.

Ora, digita il codice:

Inserimento del codice TOTP al momento dell'accesso.

Se il codice è corretto sarai reindirizzato al tuo account Nextcloud.

Nota

Since the code is time-based, it is important that your server’s and your smartphone’s clock are almost in sync. A time drift of a few seconds won’t be a problem.

Usare l’autenticazione a due fattori con token fisici

Puoi usare l’autenticazione a due fattori basato su token fisici. I seguenti dispositivi sono funzionanti:

Usare applicazioni client con l’autenticazione a due fattori

Once you have enabled 2FA, your clients will no longer be able to connect with just your password unless they also have support for two-factor authentication. To solve this, you should generate device-specific passwords for them. See Gestisci browser e dispositivi connessi for more information on how to do this.

Considerazioni

If you use WebAuthn to log in to your Nextcloud, be sure to not use the same token for 2FA, as this would mean you are again only using a single factor.