Skip to content

Instantly share code, notes, and snippets.

  • Star 75 You must be signed in to star a gist
  • Fork 9 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save xcatliu/4e1d5e69fc5f8a49e4e6 to your computer and use it in GitHub Desktop.
(已失效)中国区用户在开启 GitHub 两步验证中遇到的问题
2023.8.28
据多名网友回复,此方法已失效。
最新解决办法请参考此贴:[v2ex: 请问 github 的两步验证(two-factor authentication)大家是怎么做的?](https://www.v2ex.com/t/967533)
https://www.v2ex.com/t/967533
---
今天发现 GitHub 有两步验证的功能,于是打算开启,可是悲剧的是,到了填写手机号的时候,发现没有 China 的选项。
于是我尝试了下修改网页源代码,添加了 `<option value="+86">China +86</option>` 再填手机号,居然就收到短信了。
后来有点不放心,还是给 https://github.com/contact 发了个反馈,然后收到回信说由于某些国家的短信发送成功率无法保证,所以没有开启两步验证功能。
不过在我这段时间的使用过程中,还是挺稳定的,每次都能收到短信。
大家如果也需要开启两步验证,最好把 Recover code 也记下来吧,避免以后短信收不到。
## Massage sent to GitHub Contact
I found that the country code field has no option for Chinese users when I was enabling two-factor authentication via SMS:
```html
<select class="js-country-code-select js-2fa-confirm" autocomplete="tel-country-code" name="countrycode">
...
<option value="+257">Burundi +257</option>
<option value="+855">Cambodia +855</option>
<option value="+1">Canada +1</option>
<option value="+238">Cape Verde +238</option>
<option value="+1345">Cayman Islands +1345</option>
<option value="+61">Christmas Island +61</option>
<option value="+61">Cocos +61</option>
<option value="+243">Congo, Dem Rep +243</option>
<option value="+385">Croatia +385</option>
<option value="+357">Cyprus +357</option>
<option value="+420">Czech Republic +420</option>
<option value="+45">Denmark +45</option>
...
</select>
```
I am wondering if this is a bug?
BTW, I have fixed the problem by adding `<option value="+86">China +86</option>`, and it works because I have received the message from GitHub!
## Email received from GitHub staff
Hi Xcat,
Due to the importance of two factor authentication messages we want to be extremely confident in the delivery rates before we enable one time password delivery via SMS since heavy delays render the one time password useless and being unable to receive one prevents you from accessing your account.
This is the reason that SMS is not presented as an option in some countries. As our provider advises us on the delivery status in specific countries we'll revise the list:
https://help.github.com/articles/countries-where-sms-authentication-is-supported/
Thanks,
@joyous-coder
Copy link

北京联通+1

@joyous-coder
Copy link

收藏了

@zslwyuan
Copy link

zslwyuan commented Oct 3, 2021

这都行服了。。。广州移动+1

@JustCod101
Copy link

nb, 学到了,膜拜大佬

@Hahet
Copy link

Hahet commented Jun 30, 2022

6 好用

@hsiong
Copy link

hsiong commented Jul 18, 2022

谢谢大佬 稳

@THUGAF
Copy link

THUGAF commented Sep 2, 2022

亲测可用

@huanlirui
Copy link

牛逼

@VernHe
Copy link

VernHe commented Sep 7, 2022

太强了!

@yanjinbin
Copy link

yanjinbin commented Sep 22, 2022

杭州 移动用户 不行

We tried delivering an SMS to that number, but the number doesn't seem to be valid.

@vanniszsu
Copy link

上海移动,也不行
We tried delivering an SMS to that number, but the number doesn't seem to be valid

@kenshinji
Copy link

两步验证可以用authenticator app吧

@89ao
Copy link

89ao commented Dec 13, 2022

测试失效,应该是已经修复了吧?

@wk3368
Copy link

wk3368 commented Dec 31, 2022

We tried delivering an SMS to that number, but the number doesn't seem to be valid.

not working any more

@JianWillWang
Copy link

不要扫描二维码,在microsoft authenticator里面手动输入security key,然后就ok了

@zmggit
Copy link

zmggit commented Aug 15, 2023

We tried delivering an SMS to that number, but the number doesn't seem to be valid.

别提了 真的恶心 杭州移动

@13RTK
Copy link

13RTK commented Aug 15, 2023

太牛了,直接改页面^_^

@HeSuxiang
Copy link

失效了啊

@asmwarrior
Copy link

我这里也不能用,提示就是和上面的 “We tried delivering an SMS to that number, but the number doesn't seem to be valid.” 一样的文字内容。

@sunzhuo
Copy link

sunzhuo commented Aug 24, 2023

同样的问题

@yanhuan0802
Copy link

我这里也提示 We tried delivering an SMS to that number, but the number doesn't seem to be valid.

@joyous-coder
Copy link

突然之间用不了了,好在我有github mobile版本可以替换进行认证

@fokx
Copy link

fokx commented Jan 13, 2024

@HeSuxiang
Copy link

最新可用方法: https://jasonlee529.github.io/2023/11/16/bb34d8396f47.html
good job, 不过我现在用谷歌验证器了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment