最近上GitHub一直都会弹出一个黄色框框,提示要开启2FA(two-factor authentication,即:双重身份验证)。
本文转载自:https://www.didispace.com/article/richang/github-enable-2fa.html
GitHub users are now required to enable two-factor authentication as an additional security measure.
Your activity on GitHub includes you in this requirement.
You will need to enable two-factor authentication on your account before October 06, 2023,
or be restricted from account actions.
![图片[1]-GitHub 2FA(双重身份验证)没有中国选项,要怎么开启?-Java专区论坛-技术-SpringForAll社区](https://static.didispace.com/images3/c2b944784939a9d1a92d5ded16a3c315.png)
弹了很久,一直都没去处理,新血来潮,今天想去掉这个东西。
但是,很扯淡的是,第一步就卡住了,国家选择里压根没中国:
![图片[2]-GitHub 2FA(双重身份验证)没有中国选项,要怎么开启?-Java专区论坛-技术-SpringForAll社区](https://static.didispace.com/images3/32775559a4054359b1fdfd978a6b7f9a.png)
同时,这里居然有台湾?
![图片[3]-GitHub 2FA(双重身份验证)没有中国选项,要怎么开启?-Java专区论坛-技术-SpringForAll社区](https://static.didispace.com/images3/be4104b22296cd5a5dfb067ff7be66b1.png)
看到网友有分享通过浏览器工具手工添加下面这段js来手工添加China选项来完成流程的
var option = new Option("China +86","+86");
option.selected = true;
document.getElementById('countrycode').options.add(option, 0);
但DD试了一下,貌似短信都发不过来(可能之前可以吧):
![图片[4]-GitHub 2FA(双重身份验证)没有中国选项,要怎么开启?-Java专区论坛-技术-SpringForAll社区](https://static.didispace.com/images3/abe2a12543c650a5f5c34e3c1cbab414.png)
最后,还是通过身份验证App来完成了。你只需要点击页面底部这里进入:
![图片[5]-GitHub 2FA(双重身份验证)没有中国选项,要怎么开启?-Java专区论坛-技术-SpringForAll社区](https://static.didispace.com/images3/b94dc0a069c7227d60e2fcba23b84862.png)
根据页面提示,使用1Password、Authy、Microsoft Authenticator等身份验证类App(DD这里用的Microsoft Authenticator)来扫下面的二维码
![图片[6]-GitHub 2FA(双重身份验证)没有中国选项,要怎么开启?-Java专区论坛-技术-SpringForAll社区](https://static.didispace.com/images3/f1b82de3ecbe7f0f857d4792bccbdad6.png)
扫码后,上面这些身份验证App,都会产生一个一次性密码,直接输入上图中的底部输入框,然后继续就完成了。
![图片[7]-GitHub 2FA(双重身份验证)没有中国选项,要怎么开启?-Java专区论坛-技术-SpringForAll社区](https://static.didispace.com/images3/845501193539a97e3d3426cd8b6cab5c.png)