GitLab 启用双因子认证后无法 pull

本文讲述了在GitLab中遇到HTTPBasic访问被拒时,由于双因子认证(2FA)启用,需使用个人访问令牌(PersonalAccessToken)替换密码进行认证的过程。个人令牌可用于访问GitLabAPI并通过HTTP进行身份验证。
摘要由CSDN通过智能技术生成

参考:

【GitLab】-HTTP Basic: Access denied.remote:You must use a personal access token-CSDN博客


拉取时会报这个错误:

Access denied. The provided password or token is incorrect or your account has 2FA enabled and you must use a personal access token instead of a password. See https://gitlab.

2FA 就是双因子认证。这时候需要用访问令牌来代替你的 password

 格式:git clone http://{username}:{token}@{URL}

令牌有效期最大12个月

关于令牌:
“Personal Access Tokens
You can generate a personal access token for each application you use that needs access to the GitLab API.

You can also use personal access tokens to authenticate against Git over HTTP. They are the only accepted password when you have Two-Factor Authentication (2FA) enabled.”

仔细看,什么是access Tokens?access token可以用来访问GitLab API,可以通过HTTP的方式认证,当启用Two-Factor Authentication (2FA)双因子认证时,只能通过这种方式作为密码访问。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值