GitHub 2FA is something every developer meets sooner or later: GitHub requires two-factor authentication from everyone who publishes code. A phone number isn’t mandatory, but SMS is the only way to get the code without an authenticator app. GitHub only sends SMS to countries on its list, and Ukraine isn’t on it. Below: which 2FA method to choose, which country’s number works, how to set up SMS and how not to lose an account full of repositories.
Does GitHub need a phone number?
Not at sign-up: an email, password and username are enough, and the email is confirmed by a code sent to your inbox.
According to GitHub’s documentation, an account falls under mandatory 2FA if you act as a contributor: create a repository release, publish an app or an action. You then get 45 days to set it up plus a 7-day grace period. After that, logging in to github.com is blocked until 2FA is on. Existing tokens keep working, but you can’t create new tokens or authorize apps.
GitHub says plainly that mandatory 2FA doesn’t mean you must give your number. A number is needed only if you choose SMS.
GitHub 2FA methods: which to choose
| Method | How it works | Notes |
|---|---|---|
| TOTP app | A code from an authenticator that refreshes every 30 seconds | GitHub recommends it |
| SMS | A code by text message | A fallback, not supported in every country |
| Passkey | Passwordless login from a device | Requires TOTP or SMS first |
| Security key | A WebAuthn hardware key | Second factor only, after TOTP or SMS |
| GitHub Mobile | Login approval in the app | Requires TOTP or SMS first |
A practical setup for most developers: a TOTP app as the main method, a passkey for fast login and SMS to a number that will definitely stay with you as a fallback. Some organizations and enterprise accounts restrict members whose 2FA uses SMS, so check your company’s policy first.
Which countries GitHub sends SMS to
GitHub only sends SMS to countries on its list, where delivery is reliable enough. As of December 2026 the list has about 105 countries and territories, but Ukraine isn’t among them, nor are Moldova or Kazakhstan. The list changes from time to time, so check it in GitHub’s documentation.
How to turn on SMS 2FA on GitHub
- Click your profile picture and open Settings.
- Under Access, choose Password and authentication.
- In Two-factor authentication, click Enable two-factor authentication.
- Pass the CAPTCHA and go to SMS setup.
- Choose the country code, enter the number and request a code.
- Enter the SMS code and continue.
- Download the recovery codes and confirm you have saved them.
After setup the account enters a 28-day check-up period. If you successfully use your second factor at least once in that time, the check-up ends. Otherwise GitHub asks you to perform 2FA on day 28, so the number must still be reachable then.
- 1SettingsPassword and authentication
- 2Enable two-factorchoose SMS as the method
- 3Countrymust be on GitHub’s SMS list
- 4Codeenter the SMS code
- 5Recovery codesdownload and store them offline
How to get a number for GitHub with NOMEROK
- Create a NOMEROK account and top up using Apple Pay, Google Pay or any Visa or Mastercard card (the monobank checkout accepts European cards too), or crypto such as USDT and BTC through Trybit.
- Choose GitHub and a country on GitHub’s SMS list, for example the UK, Poland or Estonia.
- Take a rental: you will need codes when logging in from new devices and on day 28.
- In Settings → Password and authentication choose SMS, enter the number and the code from your dashboard.
- Download the recovery codes and keep them in a password manager.
How much does a GitHub number cost?
The GitHub price is live: it changes by country and supplier, and the chart and table below always show the current one. You pay from a UAH balance, and the GitHub row shows a rough US dollar equivalent. For GitHub, check the country against the SMS list first and the price second: the cheapest country in the chart won’t help if GitHub doesn’t send SMS there. Since the number is for 2FA, compare the monthly rental in your dashboard. All rates are on the prices page.
Single-use number or rental for GitHub?
| Option | Duration | For GitHub |
|---|---|---|
| Single-use number | 20 minutes for the SMS | Not suitable for SMS 2FA: the next code on a new device won’t arrive |
| Rental | from 1 day, then monthly with renewal | SMS as the main or fallback 2FA method |
GitHub asks for the SMS code at every login from a new browser or device. If the number closes, access depends only on recovery codes. So for 2FA choose a number rental: it renews in one click. The most robust setup is an authenticator as primary, with the rented number and recovery codes as backup.
GitHub SMS not arriving: what to check
The country isn’t supported
If the number’s country isn’t on GitHub’s list, delivery isn’t guaranteed. Take a number from a listed country or use an authenticator.
Number format
Pick the country code and enter the number without the leading zero.
The code never came
On a single-use number, after 20 minutes the money returns to your balance (see the refund terms). On a rental, request the code again after a minute.
Lost access to GitHub 2FA: what to do
- A recovery code is the fastest way; each code works once.
- A passkey or security key, if you added one.
- An account recovery request. If you know the password, GitHub sends a one-time code to your verified email. Then you prove your identity with a verified device, SSH key or personal access token. Review can take up to three working days.
GitHub no longer lets you set up a backup SMS number in addition to the main one. Without codes and recovery methods, according to the documentation, GitHub support won’t restore access. Save the recovery codes right after setup: that matters more than the choice of method.
How to protect your GitHub account
- Turn on 2FA early, without waiting for the 45-day deadline.
- Don’t enter codes on pages opened from “suspicious activity” emails; check the github.com address.
- Review SSH keys and tokens in settings and remove unused ones.
- Keep personal and work accounts apart if your company has its own security policy.
Working with other developer services? See numbers for Microsoft and OpenAI.