Skip to content

Instantly share code, notes, and snippets.

@Nixes
Last active May 21, 2024 06:25
Show Gist options
  • Save Nixes/1841ac29cb700d17a1e01ce724e49191 to your computer and use it in GitHub Desktop.
Save Nixes/1841ac29cb700d17a1e01ce724e49191 to your computer and use it in GitHub Desktop.
create and add ssh based git deploy key

Guide to create and use ssh key based git deployment

  1. Generate key with ssh-keygen, as path enter the same as suggested with a different filename of 'git'
  2. run sudo nano ~/.ssh/config and add contents like
# add bitbucket deployment key to identity file
Host bitbucket.org
    User git
    IdentityFile ~/.ssh/git
  1. Correct the permissions of the file if it is the first time being used to chmod 600 ~/.ssh/config and sudo chown currentUserName:currentUserGroup ~/.ssh/config
  2. dump public key to console with cat ~/.ssh/git.pub
  3. copy this key into the bitbucket/github add keys input

Done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment