Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/bash/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Bash Git推送不';无法在ubuntu子系统中工作(权限被拒绝(公钥))_Bash_Git_Github - Fatal编程技术网

Bash Git推送不';无法在ubuntu子系统中工作(权限被拒绝(公钥))

Bash Git推送不';无法在ubuntu子系统中工作(权限被拒绝(公钥)),bash,git,github,Bash,Git,Github,我最近设置了SSH密钥,以便在使用git时使用它而不是HTTPS。 配置完全正常,但现在当我尝试使用时:git-push-origin-master 在ubuntu终端中,它不工作。 我得到一个错误: git@github.com: Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and

我最近设置了SSH密钥,以便在使用git时使用它而不是HTTPS。
配置完全正常,但现在当我尝试使用时:git-push-origin-master 在ubuntu终端中,它不工作。

我得到一个错误:

git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
它在windows power shell和git bash中工作。

但我希望它能在ubuntu(设置为windows的子系统)中工作。

你也添加了ubuntu公钥吗?(
cat~/.ssh/id_rsa.pub
)您的意思是创建一个新密钥作为第二个ssh密钥?我接着说:我在ubuntubu中运行的所有推荐都是空的,idk为什么这个解决方案解决了我为ubuntu添加的第二个密钥的问题。它需要保存在/home/you/.ssh/id\u rsa中