User Tools

Site Tools

blog:2021-01-14_git_permission_denied_publickey_issue



2021-01-14 git permission denied (publickey) issue in Windows

  • I am facing git permission denied (publickey) issue in Windows environment.
  • jethro@DESKTOP-JETHRO MINGW64 /e/PROJECTS/VS2019_CSharp/My Simulator
    $ ssh -T git:jethro@gitlab.domain.com -p 1010
    git:jethro@gitlab.domain.com: Permission denied (publickey).

Solution

  • 1, I add a config file in “C:\Users\jethro\.ssh”
    Host gitlab.domain.com
    Hostname gitlab.domain.com
    IdentityFile C:\Users\jethro\.ssh\id_rsa
    IdentitiesOnly yes
    Port 1010
    User git
  • 2, Ensure ssh-agent is enabled
    jethro@DESKTOP-JETHRO MINGW64 /e/PROJECTS/VS2019_CSharp/My Simulator
    $ eval "$(ssh-agent -s)"
    Agent pid 1875
  • 3, Add my SSH key to the ssh-agent
    $ ssh-add c:/users/jethro/.ssh/id_rsa
    Identity added: c:/users/jethro/.ssh/id_rsa (c:/users/jethro/.ssh/id_rsa)
  • 4, Test again.
    jethro@DESKTOP-JETHRO MINGW64 /e/PROJECTS/VS2019_CSharp/My Simulator
    $ ssh -T git:jethro@gitlab.domain.com -p 1010
    Welcome to GitLab, @jethro!

TAGS

  • 262 person(s) visited this page until now.

Permalink blog/2021-01-14_git_permission_denied_publickey_issue.txt · Last modified: 2021/01/14 13:51 by jethro

oeffentlich