我通过Nix(on)安装了Git
Arch Linux
).
[gorre@uplink ~]$ uname -a
Linux uplink 4.16.9-1-ARCH #1 SMP PREEMPT Thu May 17 02:10:09 UTC 2018 x86_64 GNU/Linux
[gorre@uplink ~]$ nix-env -q
erlang-20.3.2
git-2.16.3
go-1.10.1
google-drive-ocamlfuse-0.6.25
nix-2.0.2
我将SSH配置文件保存在
~/.ssh/config
:
[gorre@uplink ~]$ cat ~/.ssh/config
# Bitbucket.org
Host bitbucket.org
#RSAAuthentication yes
IdentityFile ~/.ssh/bitbucket_id_rsa
IdentitiesOnly yes
我100%确定私钥/公钥集是正确的。我在SmartGit中一直使用它,但当我试图通过命令行使用Git时,我遇到了以下错误:
[gorre@uplink erlang]$ git pull --rebase
sign_and_send_pubkey: signing failed: agent refused operation
git@bitbucket.org: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
有没有办法让Git(通过Nix安装)参考我的
~/.ssh/config
文件
作为证明,这就是我“指示”
ssh-agent
要临时使用我的公钥(以便您确定我拥有正确的权限):
[gorre@uplink erlang]$ ssh-agent sh -c 'ssh-add ~/.ssh/bitbucket_id_rsa; git pull --rebase'
Enter passphrase for /home/gorre/.ssh/bitbucket_id_rsa:
Identity added: /home/gorre/.ssh/bitbucket_id_rsa (/home/gorre/.ssh/bitbucket_id_rsa)
Already up to date.
Current branch master is up to date.
...在那之后,我
自由飞行
有一段时间:
[gorre@uplink erlang_simple_cache]$ git pull --rebase
Already up to date.
Current branch master is up to date.