在我将密钥添加到 Bitbucket 后,服务器一直要求输入密码
Server keeps asking for password after i added my key to Bitbucket
我搜索了一下,找到了 some simular 个主题,但没有适合我的解决方案
我在 Bitbucket 上有几个存储库,一些是私有的,一些是团队的。我以团队 (nskiv) 作为所有者创建了一个新的存储库 (webroot)。我用 git remote add origin git@bitbucket.org:nskiv/webroot.git
在本地添加了这个
我添加了一些文件并将它们推送到存储库。然后我连接到我的服务器,当我尝试拉动时,我经常必须输入我的密码。当我这样做时它工作正常,但它很烦人且没有必要。
奇怪的是我没有使用 HTTPS link。我的本地 .git/config
看起来像这样:
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = true
[remote "origin"]
url = git@bitbucket.org:nskiv/webroot.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
在我的服务器上,我使用我的用户名 (maurice) 登录并将我的密钥复制 (cat /home/maurice/.ssh/id_rsa.pub | pbcopy
) 到团队的 SSH 密钥设置。
当我尝试克隆存储库 (git clone git@bitbucket.org:nskiv/webroot.git
) 时,我必须输入我的密码。但是为什么?
编辑:
解决方案是使用 eval 激活 ssh 代理 "$(ssh-agent -s)"
第一步我忘记配置我的服务器
答案可能是您没有 SSH 代理 运行。我会完成 these 个步骤并确保您有 SSH 代理 运行 并且您已将密钥添加到其中。
我搜索了一下,找到了 some simular 个主题,但没有适合我的解决方案
我在 Bitbucket 上有几个存储库,一些是私有的,一些是团队的。我以团队 (nskiv) 作为所有者创建了一个新的存储库 (webroot)。我用 git remote add origin git@bitbucket.org:nskiv/webroot.git
我添加了一些文件并将它们推送到存储库。然后我连接到我的服务器,当我尝试拉动时,我经常必须输入我的密码。当我这样做时它工作正常,但它很烦人且没有必要。
奇怪的是我没有使用 HTTPS link。我的本地 .git/config
看起来像这样:
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = true
[remote "origin"]
url = git@bitbucket.org:nskiv/webroot.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
在我的服务器上,我使用我的用户名 (maurice) 登录并将我的密钥复制 (cat /home/maurice/.ssh/id_rsa.pub | pbcopy
) 到团队的 SSH 密钥设置。
当我尝试克隆存储库 (git clone git@bitbucket.org:nskiv/webroot.git
) 时,我必须输入我的密码。但是为什么?
编辑:
解决方案是使用 eval 激活 ssh 代理 "$(ssh-agent -s)"
第一步我忘记配置我的服务器
答案可能是您没有 SSH 代理 运行。我会完成 these 个步骤并确保您有 SSH 代理 运行 并且您已将密钥添加到其中。