title: Problem with private ssh key trying to connect jenkins with github
body: <p>I'm creating a task on Jenkins version 2.235.1 on a computer using Ubuntu version 18.04.3 LTS  to do CD using a repo on Github.
  I have it all working using username and password to log on Github.</p>
  <p>The issue is that GitHub is no longer going to support username and password connection and I will need to connect by ssh username with private key.
  I tried the process following all the necessary steps and I still can't manage to connect.</p>
  <p>I'm gonna carefully elaborate the steps of connection.
  Hopefully, someone can tell me what I'm doing wrong.</p>
  <p>I have created an id_rsa for a user called Jenkins using this command:</p>
  <pre><code> ssh-keygen -t rsa -b 4096 -C &quot;my_github@email.com&quot;
  </code></pre>
  <p>with a passphrase “my_passphrase”</p>
  <p>I have placed the public key on Github to the user  “user_name” (The owner of the repo)</p>
  <p>This works, since I can execute the following command from the server:</p>
  <pre><code>git ls-remote -h -- git@github.com:user_name/proyect_name.git 
  </code></pre>
  <p>After asking me for my passphrase it returns all repo branches.
  So my public key and private key are working correctly.</p>
  <p>Next step is setting credentials on Jenkins to connect to Github.
  I'm setting my credentials like so:</p>
  <p>Kind: SSH username with the private key</p>
  <pre><code>   Scope: Global
     Id: empty
     Description: empty
     Username: user_name (owner on GitHub that has a public key assigned)
     Private key: &lt;Enter directly&gt;
           -----BEGIN RSA PRIVATE KEY-----
           ......
           -----END RSA PRIVATE KEY-----
     Passphrase: my_passphrase
  </code></pre>
  <p>Im copying the private key using CAT, dragging, selecting until the last dash and doing control+shift+c.</p>
  <p>Im placing the URL of the GitHub repo like this:</p>
  <pre><code>git@github.com:user_name/proyect_name.git 
  </code></pre>
  <p>When it tries to connect it throws the following error:</p>
  <pre><code> Failed to connect to repository :
      Command &quot;git ls-remote -h -- git@github.com: user_name/proyect_name.git HEAD&quot;
      returned status code 128:
      stdout:
      stderr: git@github.com: Permission denied (public key).
      fatal: Could not read from remote repository.
  
  Please make sure you have the correct access rights
  and the repository exists.
  </code></pre>
  <p>Could it be that I'm not pasting the private key correctly??</p>
  <p>Thanks very much in advance, any help will be greatly appreciated.</p>
  <p>Jorge</p>