身份验证失败到 bitbucket [英] Authentication failed to bitbucket

查看:39
本文介绍了身份验证失败到 bitbucket的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 sourcetree 通过 bitbucket 上的 https 协议推送我的项目.
但是我无法使用我的登录名和密码(在网站上有效)连接到 bitbucket,我有一个致命错误:身份验证失败".

我在其他帖子上读到我可以使用 ssh 协议而不是 https 协议解决这个问题,所以我按照 源树常见问题解答.但是现在我不知道当我想推送我的代码时如何更改为 ssh 协议.有人知道我该怎么做吗?谢谢.

解决方案

如果您遇到 GIT 控制台的身份验证问题,您可以尝试将您的配置切换到 HTTPS 并指定用户 &使用以下命令输入密码:

https://:@bitbucket.org//.git

但要小心:回到我很久以前做的这个答案,我想感谢@ChristopherPickslay 指出密码以明文形式存储在 .git/config 文件中.>

如果您想使用 HTTPS,您可以使用 Git 凭证管理器安全地存储您的密码

但就我个人而言,我现在总是使用 SSH 身份验证,因为这似乎是一种更好的做法,因为您使用一对个人公钥/私钥,可以防止您的密码被存储在外面.除了您可以在密钥上放置密码之外,您还需要将密码存储在凭证管理器或 ssh-agent 上.

I'm trying to push my project via the https protocol on bitbucket using sourcetree.
But I can't connect to bitbucket with my login and password (which work on the website), I have a fatal error : "Authentication failed".

I read on other posts I can work around the problem using the ssh protocol instead of the https one, so I set up a ssh key following instructions on the source tree faq. But now I don't know how I can change to the ssh protocol when I want to push my code. Someone know how I can do this ? Thank you.

解决方案

If you got authentication issues with the GIT console, you can try to switch your configuration to HTTPS and specify user & password with the following command :

https://<username>:<password>@bitbucket.org/<username>/<repo>.git

BUT CAREFUL: Coming back to this answer that I made a very long time ago, I want to give credits to @ChristopherPickslay for pointing out that the password is stored as clear text in the .git/config file.

If you want to roll with HTTPS, you can securely store your password with Git credential manager

But personnally, I now always use SSH authentification, as it seems to be a better practice, because you use a personal pair of public/private keys that will prevent your password to be stored outside. Apart from the fact you can put a passphrase on your key, and then you also need to store the password on a credential manager or ssh-agent.

这篇关于身份验证失败到 bitbucket的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆