Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Git使用未知方法对我的bitbucket进行身份验证_Git_Ssh_Bitbucket - Fatal编程技术网

Git使用未知方法对我的bitbucket进行身份验证

Git使用未知方法对我的bitbucket进行身份验证,git,ssh,bitbucket,Git,Ssh,Bitbucket,我的所有类似主题都试图解释如何配置git以便能够使用bitbucket/github。 我的主题是关于不同的故事。 我可以推送/克隆/提交-对bitbucket上的存储库执行任何操作,但是: 1) 我的存储库在设置中没有任何“访问密钥” 2) 我的git配置: user.name=No Matter user.email=anybody@fromanywhere.com core.repositoryformatversion=0 core.filemode=true core.bare=fal

我的所有类似主题都试图解释如何配置git以便能够使用bitbucket/github。 我的主题是关于不同的故事。 我可以推送/克隆/提交-对bitbucket上的存储库执行任何操作,但是:

1) 我的存储库在设置中没有任何“访问密钥”

2) 我的git配置:

user.name=No Matter
user.email=anybody@fromanywhere.com
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
remote.origin.url=ssh://git@bitbucket.XXXX:7999/~someuser/test.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master
branch.preprod.remote=origin
branch.preprod.merge=refs/heads/preprod
当我试图找出使用了哪个SSH密钥时,我读了很多关于stackoverflow的主题,我应该使用“SSH-vT”git@bitbucket.XXX“但最后它问我密码

debug1: Next authentication method: publickey
debug1: Offering RSA public key: /someuser/.ssh/id_rsa
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Trying private key: /someuser/.ssh/id_dsa
debug1: Trying private key: /someuser/.ssh/id_ecdsa
debug1: Trying private key: /someuser/.ssh/id_ed25519
debug1: Next authentication method: password
git@bitbucket.XXXX's password:
当我使用诸如:git pull;git推送?

试试这个:

 ssh -v git@bitbucket.com
这会给你类似的东西

OpenSSH_7.9p1, OpenSSL 1.1.1a  20 Nov 2018
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Connecting to bitbucket.com [18.205.93.4] port 22.
debug1: Connection established.
debug1: identity file /c/Users/sdr/.ssh/id_rsa type -1

在那一行你可以看到它在哪里。通常它们在这里
~/.ssh/config
您需要在命令中提供端口,否则
ssh
将假定您正在尝试端口22。(bitbucket.XXXX:22上有一些内容正在侦听,但它不是您的bitbucket服务器实例-它可能是主机操作系统上的sshd。)


尝试类似于
ssh-Tp7999的方法git@bitbucket.XXXX
-p
标志允许您为SSH指定一个非标准端口——在本例中,根据您的git配置,它是端口7999。您也可以尝试
ssh-Tp433git@altssh.bitbucket.org
以Bitbucket云为例。

我已经提到了ssh-v命令的输出。它要求我输入密码——所以它不使用ssh密钥——当我使用git命令进行repo时,一切正常——但为什么?你试过写密码吗?之后会发生什么?如果你需要一个快速的解决方案,你也可以下载gitKraken,它可以自动生成ssh并连接到每个git服务我不知道bitbucket站点上git用户的密码(我甚至没有访问它后端的权限)。我只知道我的someuser用户的linux密码。@Jim_Redmond指定端口时向我显示了用于身份验证的密钥!但下一个问题是如何检查哪个密钥用于指定的存储库而不是整个域。我的repo有空的“访问密钥”选项卡,我应该在其中放置ssh密钥。是否有与特定用户帐户关联的密钥?