“WSL 上的 git”
Ubuntu 20.04LTS
WSL在基本上不应该有太大变化。
因为密钥存在于Windows主机端,所以我想要与之一同使用。
确认无法连接。
ssh -T git@github.com
The authenticity of host 'github.com (52.192.72.89)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no/[fingerprint])?
如果这是对于 GitHub 主机的确认,请按“是”按钮,以确认该一致性。
yes
Warning: Permanently added 'github.com,52.69.186.44' (RSA) to the list of known hosts.
git@github.com: Permission denied (publickey).
因为没有进行任何设置,所以无法访问。
进行keu的设置。
~/.ssh/config的设置。
由于Windows被挂载在/mnt/c/下,所以可以共用。
$ more config
Host github.com
User KojiKobayashi
IdentityFile /mnt/c/Users/k.kobayashi/(ppkへのパス)
用户好像可以使用注册邮箱。
再确认一次。
$ ssh -T git@github.com
Warning: Permanently added the RSA host key for IP address '52.192.72.89' to the list of known hosts.
Enter passphrase for key '/mnt/c/Users/k.kobayashi/(ppkへのパス)':
Hi KojiKobayashi! You've successfully authenticated, but GitHub does not provide shell access.
追加:
不知何时,钥匙不再可用。
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: UNPROTECTED PRIVATE KEY FILE! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0777 for '/mnt/c/Users/キーのパス' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
Load key "/mnt/c/Users/キーのパス": bad permissions
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
由于无法解决,所以将密钥复制到Linux端并更改权限(600)。