Skip to content

Instantly share code, notes, and snippets.

View vitalykarasik's full-sized avatar

Vitaly Karasik vitalykarasik

View GitHub Profile
@bondarenkod
bondarenkod / git-windows-ssh.md
Last active April 24, 2025 14:41
Git SSH: Permission denied (publickey). fatal: Could not read from remote repository.

If you encounter the following error on Windows: Permission denied (publickey). fatal: Could not read from remote repository. But at the same time, the command ssh -vT [email protected] gives you this message: Hi USER_NAME! You've successfully authenticated, but GitHub does not provide shell access.

  • Add to your environment variables: GIT_SSH_COMMAND="C:/Windows/System32/OpenSSH/ssh.exe". Ensure there's no space after the equal sign. Also, verify that the path is correct for your OS.
  • Alternatively, change the Git configuration by running: git config --global core.sshCommand C:/Windows/System32/OpenSSH/ssh.exe