解决You‘ve successfully authenticated, but GitHub does not provide shell access.

解决You've successfully authenticated, but GitHub does not provide shell access.

问题

在git push 的时候提示输入账号密码。但我在另一个项目配置过 ssh 免密的。并且现在 git 也不允许 http 连接,所以提供账号密码也没办法 push。

$ git push -u origin main
Username for 'https://github.com': xx@qq.comxx
Password for 'https://xx@qq.com@github.com': 
remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.
remote: Please see https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information.
fatal: Authentication failed for 'https://github.com/balala8/N0va_for_mac.git/'

原因&解决

虽然是用 git 命令push,但本质上仍然是 https,所以不允许提交。
使用 git remote -v 查看现在的远程 url 地址。

git remote -v
origin	https://github.com/balala8/N0va_for_mac.git (fetch)
origin	https://github.com/balala8/N0va_for_mac.git (push)

使用下面的改 url 链接。

git remote set-url origin  git@github.com:balala8/N0va_for_mac.git   

再次查看

git remote -v                                                     
origin	git@github.com:balala8/N0va_for_mac.git (fetch)
origin	git@github.com:balala8/N0va_for_mac.git (push)

已经改为 ssh 了。现在可以正常 push 了。

后续

使用ssh测试链接。

ssh git@github.com  

会发现

You've successfully authenticated, but GitHub does not provide shell access.

这句话其实一直存在,它只是想告诉你,github 不允许 shell 交互。仅此而已。

  • 35
    点赞
  • 44
    收藏
    觉得还不错? 一键收藏
  • 5
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值