7

This is the error I'm receiving:

no such identity: /home/eduan/.ssh/id_dsa: No such file or directory
no such identity: /home/eduan/.ssh/id_ecdsa: No such file or directory
Permission denied (publickey).

That's what happens when I try to push, or in this case when I do ssh -T git@github.com.

I have correctly generated the id_rsa and id_rsa.pub files.

How may I go about solving this? I'm using Arch Linux with E17 BTW.

EDIT:
@kortix would the following work for this?:

Host github.com
    IdentityFile ~/.ssh/id_rsa

It doesn't seem to work for me yet... I get the following when I push with Git:

Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

I made sure the repo exists, and I also updated the remote URL with git remote set-url origin git@github.com:Greduan/dotfiles.git.

I also added the SSH key to the list of accepted SSH keys in GitHub. What else should I do?

4

1 回答 1

10

SSH 客户端会在您生成时告诉您id_dsa(注意“d”——它代表 DSA)id_rsa(注意“r”代表 RSA)。

您应该生成一个 DSA 密钥或告诉 SSH 使用哪个“身份”(私钥)。这可以使用远程文件中自定义条目IdentityFile下的指令来完成(请参阅手册页)。Host~/.ssh/configgithubssh_config(5)

更新(2013-04-29,让下一位读者更清楚)。问题的本质是 OP 在他的~/.ssh/id_rsa密钥上有错误的所有者(root),所以 OpenSSH 客户端首先尝试读取该密钥,失败,然后继续尝试读取~/.ssh/id_dsa~/.ssh/id_ecdsa反过来,这也失败了——这次因为它们根本不存在。由于没有更多密钥可用于 pubkey 身份验证,也没有可用的身份验证机制,SSH 客户端失败。那些“没有这样的身份……”的信息实际上是警告。

于 2013-04-17T16:16:13.510 回答