Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.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
Can';安装zsh后,请不要通过ssh提交到github remote_Git_Github_Ssh_Zsh_Windows Subsystem For Linux - Fatal编程技术网

Can';安装zsh后,请不要通过ssh提交到github remote

Can';安装zsh后,请不要通过ssh提交到github remote,git,github,ssh,zsh,windows-subsystem-for-linux,Git,Github,Ssh,Zsh,Windows Subsystem For Linux,我将SSH密钥与我的Win10机器和Github帐户配对,它在Bash上工作,但今天我通过WSL安装了ZSH(噢,我的ZSH),现在当我尝试推送时,我看到了下一个错误: 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

我将SSH密钥与我的Win10机器和Github帐户配对,它在Bash上工作,但今天我通过WSL安装了ZSH(噢,我的ZSH),现在当我尝试推送时,我看到了下一个错误:

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.
ZSH中:

ssh-T-ai~/.ssh/id\u rsagit@github.com
git@github.com:权限被拒绝(公钥)。
Bash中

$ssh-T-ai~/.ssh/id\u rsagit@github.com
嗨,用户名!您已成功通过身份验证,但GitHub不提供shell访问。
与中一样,检查
~/.zshrc
的内容,并确保
ssh
没有别名

正如所评论的,一个
ssh-Tv
将准确地显示在您的zsh会话中ssh命令所考虑的文件。

为了遵循您的步骤,我在Ubuntu(WSL2)上安装了zsh。在我的例子中,我可以通过ZSH shell推到远程。 问题似乎出在WSL内部的SSH密钥中。 按照以下步骤生成另一个密钥,以便在WSL中配对


这是因为Windows中的第一个SSH密钥位于一个位置,而您现在需要的SSH密钥需要放在WSL中。

您也是通过WSL使用
bash
,还是Git-bash?请使用“-v”选项运行SSH以打印调试信息,然后,您的问题将包括调试输出。
git push
会使用
ssh
别名还是二进制?@phd仅当存在类似于
git config--global url的配置时。”git@github.com:“。代替https://github.com/