gpt4 book ai didi

linux - 在 ssh 上使用 git 不会获取私钥

转载 作者:太空狗 更新时间:2023-10-29 12:15:26 24 4
gpt4 key购买 nike

我的主要开发箱使用 Linux Mint。当我在电脑前时,我可以毫无问题地执行 git fetch 等远程操作。

我登录的用户是“jonbri”。

> whoami
jonbri

在 ~/.ssh (/home/jonbri/.ssh) 中是我的私钥 (/home/jonbri/.ssh/jonbri) 和公钥 (/home/jonbri/.ssh/jonbri.pub)。

但是当我在另一台计算机上时,例如另一台 Linux Mint 计算机,并且在命令行上我打开一个 ssh 远程 shell 到我的主计算机,当我尝试 git fetch 等操作时,它看起来像~/.ssh 没有被拾取。

这是我看到的(pwd 是 git 仓库的根目录):

> git fetch
Password:

然后,无论我输入什么密码都不起作用。

为了能够打开远程 ssh shell,我使用 apt-get 安装 open-ssh-server 和 open-ssh-client。

关于为什么在远程 ssh shell 中我的 key 没有被提取的任何想法。

最佳答案

SSH 可能需要标准名称 id_dsa 作为您的私钥,id_dsa.pub 作为您的公钥。

来自github documentation :

Check the directory listing to see if you already have a public SSH key. The default public key file names are:

  • id_dsa.pub

  • id_ecdsa.pub

  • id_ed25519.pub

  • id_rsa.pub

关于linux - 在 ssh 上使用 git 不会获取私钥,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26659705/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com