I need to run windows for video editing but I also do some coding. Linex is a beast and I would love to be able to use WSL on my windows computer and be able to do ssh from WSL. I am trying to start a thread where people can go to and follow the steps for WSL and Github ssh on windows. Can someone help me figure out what I am doing wrong so others can use WSL and Github as well?
My steps:
sudo apt update && sudo apt upgrade
* text=auto eol=lf
*.{cmd,[cC][mM][dD]} text eol=crlf
*.{bat,[bB][aA][tT]} text eol=crlf
(is there a way to make this automatic?)
git config --global core.autocrlf input
Git still works
dis these steps to share credentials
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 works on windows side
Git can be installed on Windows AND on WSL The root of your file system / is the mount point of your root partition, or folder, in the case of WSL. Not everything under / is the same drive. For example, on my laptop, I've installed two version of Ubuntu (20.04 and 18.04), as well as Debian.
Eureka I got it!!
After all the steps above go into your windows terminal and run:
$ ssh -T [email protected]
You should get:
You've successfully authenticated, but GitHub does not provide shell access.
Then on ubuntu enter:
$ cd
$ cd .ssh
$ code .
This will open up your ubuntu .ssh folder in VS code.
Then open power shell and run:
> cd .ssh
> code .
This will open up your windows .ssh folder in VS code.
Then you can drag and drop your windows fils to ubuntu through vs code.
Now go back to your WSL terminal and run:
$ ssh -T [email protected]
If you get:
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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).
Then run:
$ sudo chmod 600 ~/.ssh/id_rsa
$ sudo chmod 600 ~/.ssh/id_rsa.pub
Now when you run:
$ ssh -T [email protected]
You should get:
You've successfully authenticated, but GitHub does not provide shell access.
The steps would be like,
For this you can try with the following commands,
cp -r /mnt/c/Users/<username>/.ssh ~/.ssh
If the directory copy doesn't work, then you can try to copy single file as well.
cp -r /mnt/c/Users/<username>/.ssh/<file-name> ~/.ssh
If it gives error for permission, then change the permission to 600 for the file for which it shows error.
chmod 600 ~/.ssh/<file-name>
Last step should be the following command,
ssh -T [email protected]
You should be good to go now.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With