Share 2FA access to a shared account

A shared account and two-factor authentication can go together: you just need to understand what the TOTP seed is and share it with care.

What lies behind the six-digit code

The codes that change every 30 seconds in an authenticator app follow the TOTP standard (“Time-based One-Time Password”, RFC 6238). The principle fits in one sentence: the service and the app share the same secret, the seed (or TOTP secret), and each computes a code on its own side from that seed and the current time.

In practice, the app divides Unix time by 30 to get a counter, computes an HMAC-SHA1 of that counter with the seed, then extracts six digits from it (the method comes from HOTP, RFC 4226). The service does the same calculation and compares. No network exchange is needed: the app works offline, only the clocks need to be accurate.

The seed is a string of random bytes, usually 20 bytes (160 bits, the size recommended by RFC 4226). It is written in Base32 (RFC 4648), a 32-character alphabet (A to Z and 2 to 7) that can be read and typed without ambiguity: 20 bytes give exactly 32 characters, often displayed in groups of four, like JBSW Y3DP EHPK 3PXP ….

The QR code and the setup key

When you turn on two-factor authentication, the service displays a QR code. It contains a URI in the otpauth:// format, popularized by Google Authenticator and adopted by every app:

otpauth://totp/Example:team@example.com?secret=JBSWY3DPEHPK3PXP&issuer=Example&algorithm=SHA1&digits=6&period=30

It holds the issuer and the account name (for display), the seed (secret) and the calculation parameters. SHA1, 6 digits and 30 seconds are the defaults and the best supported: some apps ignore other settings, so it is best to keep them unless the service asks for something else.

Below the QR code, most services also offer to show the setup key as text (“Can't scan the code?”). It is the same seed in Base32. Every authenticator app lets you enter it manually, and it is the easiest form to pass on.

The seed is the access

Here is the key point: anyone who has the seed generates the same codes as you, today and forever, on any device. The code does not depend on the phone, only on the seed and the time, and the service cannot tell two copies apart.

So the seed is handled exactly like a password: it is kept in a vault (a password manager, for example) and shared with the same care. It is also what makes sharing possible: several people can legitimately hold the same seed.

Setting up a shared account

The company's social media account, a provider's console, a contact mailbox: some services offer only one login for the whole team. When the service offers individual access (members, roles, delegation), that is the best solution: everyone has their own two-factor authentication, and when someone leaves you simply remove their access. Otherwise, here is how to share a common 2FA properly.

  1. Capture the seed during setup. Most services show it only once. If 2FA is already on and the seed was not kept, turn it off and back on to get a new one.
  2. Store it with the password in the team's shared vault. Several password managers can compute TOTP codes themselves from the seed.
  3. Distribute it to each person who needs it, who adds it to their app.
  4. Check that everyone gets the same code at the same moment.
  5. Keep the backup codes provided by the service in the same place: they let you regain control if the seed is lost.

The kit's 2FA seed generator helps with services where you choose the seed yourself (an internal tool, for example): it produces a 20-byte seed in Base32, the otpauth:// URI, the QR code to scan and the current code, to check that the app has saved the seed correctly.

Share the seed with a colleague

A seed sent by chat stays in the conversation history, and anyone who gets in later can generate the codes. With “Send with onlyU”, the seed goes from the kit to onlyU tab to tab, in your browser, without appearing in any address or going through the kit's server. onlyU encrypts it in your browser and creates a link that opens only once, valid for 24 hours, then disappears. It is free, with no sign-up.

Your colleague receives the key grouped in blocks of four characters, with its parameters (“TOTP, 6 digits, 30 s”): they enter it in their app and compare the resulting code with yours. To keep the two factors truly separate, send the password and the seed through two separate links: someone who intercepted one would not have the other.

When someone leaves the team

Since copies of the seed are indistinguishable, the only way to remove access from someone who received it is to change it: turn two-factor authentication off and back on to get a new seed, change the account password, and redistribute both to the people who remain. Note who received access and when along the way: the next rotation will be all the simpler.

Finally, a word about time: if codes are rejected even though the seed is correct, check the device's clock. Many services tolerate a slight drift, but a phone running several minutes slow produces codes the service no longer accepts. For the password that goes with the seed, our guide on how to create a strong password explains the method.