Using git over ssh won't pick up private key

My main development box uses Linux Mint. When I am physically at the computer I can do remote operations like git fetch with no problem.

The user I log-in as is "jonbri".

> whoami
jonbri

In ~/.ssh (/home/jonbri/.ssh) is my private key (/home/jonbri/.ssh/jonbri) and public key (/home/jonbri/.ssh/jonbri.pub).

But when I am at another computer, for example another Linux Mint computer, and on the command-line I open a ssh remote shell to my main computer, when I try operations such as git fetch, it looks like the keys in ~/.ssh are not being picked up.

Here's what I see (with pwd being the root of the git repo):

> git fetch
Password:

Then, even no matter which password I enter it doesn't work.

To enable the ability to open a remote ssh shell I used apt-get to install open-ssh-server and open-ssh-client.

Any ideas why my keys aren't being picked up when inside a remote ssh shell.


SSH is likely expecting the standard names of id_dsa for your private key and id_dsa.pub for your public key.

From the 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

  • 链接地址: http://www.djcxy.com/p/25318.html

    上一篇: Jenkins SSH shell在执行远程命令之前关闭

    下一篇: 在SSH上使用git不会选择私钥