I can´t clone my github repository with a ssh key

43 Views Asked by At

I can´t clone my github repository with a ssh key , the terminal said me -"[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. I'm using WSL2 along windows 10.

I just want to able cloning repositories of my github account with a ssh key.

1

There are 1 best solutions below

1
sqrt-1 On

Check permissions on copied .ssh folder and (most of all) the private key inside that folder. You should chmod 600 the private key and also chmod 700 the .ssh folder. SSH requires you to protect your private keys.
Usually when you copy a folder or file from windows to wsl2 (starting from wsl2) it assigns by default 777 permissions.