代码之家  ›  专栏  ›  技术社区  ›  FilBot3

Git未使用SSH密钥对Azure DevOps进行身份验证

  •  0
  • FilBot3  · 技术社区  · 5 年前

    ssh-keygen -t rsa -b 4096 -C filbot@fenix
    

    然后我把它上传到我账户下的azuredevops上。但是,我无法从Azure DevOps克隆任何具有以下内容的内容 ~/.ssh/config :

    ⬢[filbot@toolbox ~]$ cat ~/.ssh/config 
    # SSH Configuration File
    Host ssh.dev.azure.com
      HostName ssh.dev.azure.com
      User git
      IdentityFile /var/home/filbot/.ssh/id_rsa
      IdentitiesOnly yes
    Host vs-ssh.visualstudio.com
      HostName vs-ssh.visualstudio.com
      User git
      IdentityFile /var/home/filbot/.ssh/id_rsa
      IdentitiesOnly yes
    

    git clone 具有以下结果的命令:

    ⬢[filbot@toolbox ~]$ git clone git@ssh.dev.azure.com:v3/$ORG/$PROJ/Developer.dudleyp.cs_pipeline_tasks
    Cloning into 'Developer.dudleyp.cs_pipeline_tasks'...
    git@ssh.dev.azure.com's password: 
    
    ⬢[filbot@toolbox ~]$ GIT_SSH_COMMAND=ssh git clone git@ssh.dev.azure.com:v3/$ORG/$PROJ/Developer.dudleyp.cs_pipeline_tasks
    Cloning into 'Developer.dudleyp.cs_pipeline_tasks'...
    git@ssh.dev.azure.com's password: 
    
    ⬢[filbot@toolbox ~]$ ssh -T git@ssh.dev.azure.com
    Warning: Permanently added the RSA host key for IP address '20.37.158.9' to the list of known hosts.
    git@ssh.dev.azure.com's password: 
    
    ⬢[filbot@toolbox ~]$ ssh -i ~/.ssh/id_rsa -T git@ssh.dev.azure.com
    git@ssh.dev.azure.com's password: 
    

    似乎Git不尊重甚至不使用我的主目录中的ssh配置,就像它以前或在Fedora或Pop的其他较旧安装中那样_操作系统。我不明白为什么它现在要这样做,以及如何获得信息来更清楚地了解这一点。

    0 回复  |  直到 5 年前
        1
  •  2
  •   Dharman vijay    5 年前

    Fedora 33 git pull or clone no longer working and/or ssh key no longer recognized

    基本上,在你的 ~/.ssh/config 文件,在每个 Host PubkeyAcceptedKeyTypes ssh-rsa

    Host ssh.dev.azure.com
      HostName ssh.dev.azure.com
      User git
      IdentityFile /var/home/filbot/.ssh/id_rsa
      IdentitiesOnly yes
      PubkeyAcceptedKeyTypes ssh-rsa
    
        2
  •  0
  •   m8usz    5 年前

        3
  •  0
  •   FilBot3    5 年前

    好像是软呢帽。我用了一个fedora32工具箱,Git工作正常。

    ➜  ~ toolbox create --release f32
    Image required to create toolbox container.
    Download registry.fedoraproject.org/f32/fedora-toolbox:32 (500MB)? [y/N]: y
    Created container: fedora-toolbox-32
    Enter with: toolbox enter --release 32
    ➜  ~ toolbox enter --release 32
    ⬢[filbot@toolbox ~]$ git clone -v git@ssh.dev.azure.com:v3/$ORG/$PROJ/Developer.dudleyp.cs_pipeline_tasks
    Cloning into 'Developer.dudleyp.cs_pipeline_tasks'...
    remote: Azure Repos
    remote: Found 45 objects to send. (88 ms)
    Receiving objects: 100% (45/45), 77.83 KiB | 25.94 MiB/s, done.
    Resolving deltas: 100% (14/14), done.
    
    推荐文章