title: Cloning remote repository gives fatal Could not read from remote repository
body: <p>Hi I think I need some help.
  I'm using Bitbucket. I have Git and Git-bash as well as Cygwin installed in Windows 10.
  I'm trying to clone from cmd window.</p>
  <p>I want to be able to run git commands from Git-bash, cygwin and from cmd window...is that doable?
  Anyway nothing is working now, so I started with Windows cmd.</p>
  <p>My SSH config file is located here: c:\Users&lt;my user id&gt;.ssh\config</p>
  <pre><code>Host &lt;info removed&gt;
      HostKeyAlgorithms +ssh-rsa
      PubkeyAcceptedAlgorithms  +ssh-rsa
  </code></pre>
  <p>I also have two SSH files with in my SSH folder:</p>
  <ul>
  <li>id_rsa</li>
  <li>id_rsa.pub
  I have followed this guide: <a href="https://support.atlassian.com/bitbucket-cloud/docs/set-up-an-ssh-key/" rel="nofollow noreferrer">https://support.atlassian.com/bitbucket-cloud/docs/set-up-an-ssh-key/</a></li>
  </ul>
  <p>Which has been generated with the command:</p>
  <pre><code>C:\Users\&lt;info removed&gt;\.ssh&gt;ssh-keygen
  Generating public/private rsa key pair.
  ...
  no passkey added
  ...
  </code></pre>
  <p>Uploaded the public key within id.rsa.pub to Bitbucket and put it with SSH keys.</p>
  <p>I have an sshd_config here:
  C:\ProgramData\ssh\sshd_config
  No changes made but I think some interesting lines are:</p>
  <pre><code>#PubkeyAuthentication yes
  #PasswordAuthentication yes
  #PermitEmptyPasswords no
  </code></pre>
  <p>Get-WindowsCapability -Online | ? name -like &quot;openssh*&quot;
  ...gives installed for both server and client</p>
  <p>Run some additional commands:</p>
  <p>Set-Service ssh-agent -StartupType Automatic</p>
  <p>Start-Service ssh-agent</p>
  <p>ssh-add $HOME\.ssh\id_rsa</p>
  <pre><code>C:\Users\&lt;my user id&gt;\source\repos&gt;git clone ssh://&lt;info removed&gt;.git  --config core.sshCommand=&quot;ssh -v&quot;
  Cloning into 'myRepo'...
  OpenSSH_9.0p1, OpenSSL 1.1.1o  3 May 2022
  debug1: Reading configuration data /c/Users/&lt;my user id&gt;/.ssh/config
  debug1: Reading configuration data /etc/ssh/ssh_config
  debug1: Connecting to &lt;info removed&gt; port &lt;info removed&gt;.
  debug1: Connection established.
  debug1: identity file /c/Users/&lt;my user id&gt;/.ssh/id_rsa type 0
  debug1: identity file /c/Users/&lt;my user id&gt;/.ssh/id_rsa-cert type -1
  debug1: identity file /c/Users/&lt;my user id&gt;/.ssh/id_ecdsa type -1
  debug1: identity file /c/Users/&lt;my user id&gt;/.ssh/id_ecdsa-cert type -1
  debug1: identity file /c/Users/&lt;my user id&gt;/.ssh/id_ecdsa_sk type -1
  debug1: identity file /c/Users/&lt;my user id&gt;/.ssh/id_ecdsa_sk-cert type -1
  debug1: identity file /c/Users/&lt;my user id&gt;/.ssh/id_ed25519 type -1
  debug1: identity file /c/Users/&lt;my user id&gt;/.ssh/id_ed25519-cert type -1
  debug1: identity file /c/Users/&lt;my user id&gt;/.ssh/id_ed25519_sk type -1
  debug1: identity file /c/Users/&lt;my user id&gt;/.ssh/id_ed25519_sk-cert type -1
  debug1: identity file /c/Users/&lt;my user id&gt;/.ssh/id_xmss type -1
  debug1: identity file /c/Users/&lt;my user id&gt;/.ssh/id_xmss-cert type -1
  debug1: identity file /c/Users/&lt;my user id&gt;/.ssh/id_dsa type -1
  debug1: identity file /c/Users/&lt;my user id&gt;/.ssh/id_dsa-cert type -1
  debug1: Local version string SSH-2.0-OpenSSH_9.0
  debug1: Remote protocol version 2.0, remote software version APACHE-SSHD-2.2.0
  debug1: compat_banner: no match: APACHE-SSHD-2.2.0
  debug1: Authenticating to &lt;info removed&gt; as 'git'
  debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory
  debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory
  debug1: SSH2_MSG_KEXINIT sent
  debug1: SSH2_MSG_KEXINIT received
  debug1: kex: algorithm: ecdh-sha2-nistp256
  debug1: kex: host key algorithm: (no match)
  Unable to negotiate with &lt;info removed&gt; port &lt;info removed&gt;: no matching host key type found. Their offer: ssh-rsa
  fatal: Could not read from remote repository.
  
  Please make sure you have the correct access rights
  and the repository exists.
  </code></pre>
  <p>I also don't understand when, where and why all config files are used.</p>
  <p>Sound like the id_rsa.pub has not been added to Bitbucket but it has!</p>
  <p>This line &quot;Reading configuration data /etc/ssh/ssh_config&quot; is confusing when I'm using Windows.</p>
  <p>So please, I really need some help to get this working.</p>