windows上的Git ssh访问

windows上的Git ssh访问,windows,git,ssh,gitlab,git-bash,Windows,Git,Ssh,Gitlab,Git Bash,我在Gitlab云服务器(基于linux)上设置了一个存储库。我按照基本指示在那里创建了一个新的回购协议 git@code.example.com:mike/repo.git 我将repo作为远程文件添加到本地git中 git remote add gitlab git@code.example.com:mike/repo.git 我在windows机器上使用Puttygen生成了一个(pk,sk)密钥对。我将这些添加到Users/mike/.ssh中,作为id\u rsa,并遵循 此外,

我在Gitlab云服务器(基于linux)上设置了一个存储库。我按照基本指示在那里创建了一个新的回购协议

git@code.example.com:mike/repo.git
我将repo作为远程文件添加到本地git中

git remote add gitlab git@code.example.com:mike/repo.git
我在windows机器上使用Puttygen生成了一个(pk,sk)密钥对。我将这些添加到Users/mike/.ssh中,作为id\u rsa,并遵循

此外,我将公钥添加到Gitlab中存储库的DeployKeys下

不幸的是,当我尝试(在Git bash中)时

它仍然要求输入我的git用户密码 git@code.example.com:mike/repo.git的密码

当我尝试

ssh -v git@code.example.com:mike/repo.git
它带着 ssh:无法解析主机名代码。example.com:mike/repo.git:没有与名称关联的地址

不清楚我错过了什么。有什么想法吗

干杯,迈克

  • 转到用户配置文件
  • 单击左侧菜单上的ssh键
  • 添加您的ssh 钥匙

  • 在bash会话中,执行ls$HOME/.ssh时是否看到密钥?是的,我在my.ssh中看到id_rsa(安全密钥)。不是我的公钥。好吧,你需要(私钥和公钥)在那里。我按照创建公钥,但仍然要求输入密码…我尝试了这个,但仍然要求输入密码。我还试图通过部署键将其添加到我的项目中。然而,它抱怨已经存在的密钥。我似乎无法在我的个人资料中启用相同的密钥,因此请尝试存储您的凭据
    git config credential.helper store
    No luck。这可能是一个普遍的ssh问题。我也不能ssh-v localhost(导致连接被拒绝)。
    ssh -v git@code.example.com:mike/repo.git