Skip to content

How to create different deploy keys for seperate repositories

Notifications You must be signed in to change notification settings

wwwutz/git-deploy-keys-setup

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 

git-deploy-keys-setup

How to create different deploy keys for seperate repositories

  • generate a ssh key-pair ssh-keygen -f /home/wwwutz/.ssh/blabla_rsa
  • add /home/wwwutz/.ssh/blabla_rsa.pub as a deploy key to repository blabla on github.molgen.mpg.de
  • edit ~/.ssh/config
Host blabla.github.molgen.mpg.de
  HostName github.molgen.mpg.de
  User git
  IdentityFile /home/wwwutz/.ssh/blabla_rsa
  IdentitiesOnly yes
  • when cloning the repo use git clone git@blabla.github.molgen.mpg.de:wwwutz/foobar.git (! hostname !)

idea behind it

  • use an individual ssh key per repository
  • ssh to a different 'host'
  • let ssh use the real host redirected by .ssh/config
  • use the individual key as configured .ssh/config

About

How to create different deploy keys for seperate repositories

Resources

Stars

Watchers

Forks

Releases

No releases published