我需要运行Windows进行视频编辑,但我还要进行一些编码。 Linex是一只野兽,我希望能够在Windows计算机上使用WSL,并能够从WSL执行ssh。我正在尝试启动一个线程,人们可以在该线程上执行Windows上的WSL和Github ssh步骤。有人可以帮助我弄清楚我做错了什么,以便其他人也可以使用WSL和Github吗?
我的步骤:
sudo apt update && sudo apt upgrade
* text=auto eol=lf
*.{cmd,[cC][mM][dD]} text eol=crlf
*.{bat,[bB][aA][tT]} text eol=crlf
(有没有办法使它自动执行?)
git config --global core.autocrlf input
Git仍然有效
dis这些步骤来共享凭据
Configure the credential manager on Windows by running the following in a Windows command prompt or PowerShell:
git config --global credential.helper wincred
Configure WSL to use the same credential helper, but running the following in a WSL terminal:
git config --global credential.helper "/mnt/c/Program\ Files/Git/mingw64/libexec/git-core/git-credential-wincred.exe"
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Git push在Windows端起作用
尤里卡我明白了!
完成上述所有步骤后,进入Windows终端并运行:
$ ssh -T [email protected]
您应该得到:
You've successfully authenticated, but GitHub does not provide shell access.
然后在ubuntu上输入:
$ cd
$ cd .ssh
$ code .
这将在VS代码中打开您的ubuntu .ssh文件夹。
然后打开电源外壳并运行:
> cd .ssh
> code .
这将以VS代码打开Windows .ssh文件夹。
然后您可以通过vs代码将Windows fils拖放到ubuntu。
现在返回您的WSL终端并运行:
$ ssh -T [email protected]
如果得到:
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: UNPROTECTED PRIVATE KEY FILE! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0666 for '/home/andre/.ssh/id_rsa' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
Load key "/home/andre/.ssh/id_rsa": bad permissions
[email protected]: Permission denied (publickey).
然后运行:
$ sudo chmod 600 ~/.ssh/id_rsa
$ sudo chmod 600 ~/.ssh/id_rsa.pub
现在运行时:
$ ssh -T [email protected]
您应该得到:
You've successfully authenticated, but GitHub does not provide shell access.