Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Perhaps GitHub's support for <a href="https://developer.github.com/guides/managing-deploy-keys/#deploy-keys">deploy keys</a> is what you're looking for? To quote that page:</p> <blockquote> <p><strong>When should I use a deploy key?</strong></p> <p>Simple, when you have a server that needs pull access to a single private repo. This key is attached directly to the repository instead of to a personal user account.</p> </blockquote> <p>If that's what you're already trying and it doesn't work, you might want to update your question with more details of the URLs being used, the names and location of the key files, etc.</p> <hr> <p>Now for the technical part: How to use your SSH key with Jenkins?</p> <p>If you have, say, a <code>jenkins</code> unix user, you can store your deploy key in <code>~/.ssh/id_rsa</code>. When Jenkins tries to clone the repo via ssh, it will try to use that key.</p> <p>In some setups, you cannot run Jenkins as an own user account, and possibly also cannot use the default ssh key location <code>~/.ssh/id_rsa</code>. In such cases, you can create a key in a different location, e.g. <code>~/.ssh/deploy_key</code>, and configure <code>ssh</code> to use that with an entry in <code>~/.ssh/config</code>:</p> <pre><code>Host github-deploy-myproject HostName github.com User git IdentityFile ~/.ssh/deploy_key IdentitiesOnly yes </code></pre> <p>Because all you authenticate to all Github repositories using <code>git@github.com</code> and you don't want the above key to be used for all your connections to Github, we created a host alias <em>github-deploy-myproject</em>. Your clone URL now becomes</p> <pre><code>git clone github-deploy-myproject:myuser/myproject </code></pre> <p>and that is also what you put as <em>repository URL</em> into Jenkins.</p> <p>(Note that you must <em>not</em> put <em>ssh://</em> in front in order for this to work.)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload