title: JetBrains (IntelliJ, PhpStorm, WebStorm ...) private git repository with SSH key
body: <p>My New Web Server need authentication with RSA 2048 key.</p>
  
  <p>I therefore generated a key, I placed the <code>ir_rsa</code> and <code>id_rsa.pub</code> files in my home folder <code>~/.ssh</code> (Windows 10).</p>
  
  <p>But When I use the cvs comment (for pull or push) I get an error :</p>
  
  <p><a href="https://i.stack.imgur.com/Chrh4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Chrh4.png" alt="enter image description here"></a></p>
  
  <p><strong>The Error Log is (with built-in SSH executable) :</strong></p>
  
  <blockquote>
    <p>15:14:14.657: [MyProject] git -c core.quotepath=false fetch origin
    --progress --prune java.io.IOException: There was a problem while connecting to mywebhost.fr:22 at
    com.trilead.ssh2.Connection.connect(Connection.java:791) at
    com.trilead.ssh2.Connection.connect(Connection.java:577) at
    org.jetbrains.git4idea.ssh.SSHMain.start(SSHMain.java:171) at
    org.jetbrains.git4idea.ssh.SSHMain.main(SSHMain.java:137) Caused by:
    java.io.IOException: Key exchange was not finished, connection is
    closed. at
    com.trilead.ssh2.transport.KexManager.getOrWaitForConnectionInfo(KexManager.java:92)
    at
    com.trilead.ssh2.transport.TransportManager.getConnectionInfo(TransportManager.java:230)
    at com.trilead.ssh2.Connection.connect(Connection.java:743) ... 3 more
    Caused by: java.io.IOException: Cannot negotiate, proposals do not
    match. at
    com.trilead.ssh2.transport.KexManager.handleMessage(KexManager.java:413)
    at
    com.trilead.ssh2.transport.TransportManager.receiveLoop(TransportManager.java:754)
    at
    com.trilead.ssh2.transport.TransportManager$1.run(TransportManager.java:469)
    at java.lang.Thread.run(Thread.java:745) fatal: Could not read from
    remote repository. Please make sure you have the correct access rights
    and the repository exists.</p>
  </blockquote>
  
  <p><strong>The Error Log is (with "Settings > Version Control > git > SSH Executable" to "native") :</strong></p>
  
  <blockquote>
    <p>15:13:50.031: [MyProject] git -c core.quotepath=false fetch origin
    --progress --prune Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct
    access rights and the repository exists.</p>
  </blockquote>
  
  <p><strong>If I use the Git command in terminal the pull or push command works good :</strong></p>
  
  <p><a href="https://i.stack.imgur.com/dzLPE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dzLPE.png" alt="enter image description here"></a></p>
  
  <p><strong>What should I do to use PhpStorm's VCS buttons?</strong></p>
  
  <ul>
  <li>I tried to set <code>Settings &gt; Version Control &gt; git &gt; SSH Executable</code> to
  "native" : Same problem</li>
  <li>I tried to Install putty utility, run "Pageant" services and import my
  private key : Same problem</li>
  <li>I tried to run <code>ssh-add</code> : Same problem</li>
  </ul>
  
  <p><a href="https://i.stack.imgur.com/VgLrj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VgLrj.png" alt="enter image description here"></a></p>
  
  <ul>
  <li>I tried to configure the <code>~/.config</code> file: Same problem</li>
  </ul>
  
  <blockquote>
    <p>Host myHost.fr<br>
      Hostname myHost.fr
      User myloginuser
      IdentityFile C:\Users\username.ssh\id_rsa</p>
  </blockquote>
  
  <p>My Git version is : <strong>2.10.2.windows.1</strong> (downloaded from <a href="https://git-scm.com/download/win" rel="nofollow noreferrer">https://git-scm.com/download/win</a>)</p>
  
  <p>My OS is Windows 10</p>
  
  <hr>
  
  <p><strong>[Edit] Solution :</strong>
  Thank you to Dmitriy Smirnov, I found the Solution :</p>
  
  <p>In the <code>C:\Program Files\Git\cmd</code> folder you will find the file <code>start-ssh-pageant.cmd</code>.</p>
  
  <p>Before launching it is necessary to create an environment variable:</p>
  
  <pre><code>Name: SSH_AUTH_SOCK
  Value: C:\Users\username\.ssh\.ssh-pageant-username
  </code></pre>
  
  <p>(I tried with Pagent from Putty, and ssh-agent from Git Bash but it did not work)</p>