😎
Docs
  • Tamm - Docs
  • Azure
    • Sentinel KQL Samples
    • Managed Identities
    • Deploy Sentinel with Terraform
  • Docker
    • Allow standard user to interact with Docker
    • Install Docker
    • Installing and working with Traefik
    • Installing specific version of Docker
    • Deploy Guacamole
    • Traefik geoblock
    • Unpoller Prometheus UCG Ultra
  • HomeAssistant
    • HAOS install on Proxmox
    • Zigbee2MQTT
    • HAOS Reverse Proxy
    • ZBDongle-E
  • Kali
    • Enable RDP
  • Kubernetes
    • Cert manager with Cloudflare
    • On prem loadbalancer metallb
    • Nginx ingress
    • Cloudinit Rancher ubuntu
    • Rancher Ubuntu 18.04 node template
    • Velero with minio backend
    • vsphere pvc (in-tree)
    • Velero cheat sheet
    • nginx annotations examples
  • Linux
    • Expand lvm disk vmware
    • Expand lvm disk fresh install
    • Disk usage
    • flush-dns
    • Netplan config example
    • Add user in photon OS
    • SSH-Keys
    • Set timezone
    • sudo nopasswd
    • Add custom alias
    • Rocky Linux commands
  • macOS
    • Uninstall System extensions
    • 1Password Github setup
  • Microsoft 365
    • Powershell Cheat sheet
  • Portainer
    • Install Portainer
    • Add docker node
  • Powershell
    • GenericList example
    • Mixed stuff n things
    • Synopsis Template
    • Powershell Oh-my-posh
    • Powershell Sync Profile
    • Cleanup and install MS Graph module
  • Proxmox
    • Disable No Subscription notification
    • Import from vmware error
    • Proxmox commands
    • Proxmox on Intel NUC
    • Proxmox E1000
  • Terraform
    • Getting started
    • Deploy Sentinel
  • Unifi
    • Unifi Network App (migration)
    • Slow vlan throughput
    • interface-explanation
  • Windows
    • Network settings access denied
    • Windows GVLK Keys
    • Windows Server 2025
Powered by GitBook
On this page
  • 1Password Git setup
  • SSH keys with multiple repositories and accounts
  • Clone a new repo using the key

Was this helpful?

  1. macOS

1Password Github setup

1Password Git setup

**Not really a 1password thing, but 1password can do lookups in the vault, though sequentially throughout all keys which might timeout before it gets to the one you want. **

SSH keys with multiple repositories and accounts

Notice! The official docs are incorrect, they state that you should download the Public key from your vault to use multiple Github accounts https://developer.1password.com/docs/ssh/agent/advanced but you should instead download the privatekey. (Since you cant authenticate your public key with the public key in your github account)

  1. Download each private key file to ~/.ssh and rename appropriately. Named mine work_git.key and personal_git.key

  2. edit OR create ~/.ssh/config

# Personal Github
Host personalgit
HostName github.com
User git
IdentityFile ~/.ssh/personal_git.key
IdentitiesOnly yes

# Work Github
Host workgit
HostName github.com
User git
IdentityFile ~/.ssh/work_git.key
IdentitiesOnly yes

This will setup

HostName for which we will need later User is always git for Github SSH keys IdentityFile the identityFile, the private key

  1. In each repository you have, check which remote you have. For the repo behind this wiki, I have

git remote -v
origin  https://github.com/qhrizz/wiki.git (fetch)
origin  https://github.com/qhrizz/wiki.git (push)
  1. Change this to the new "host"

git remote set-url origin personalgit:qhrizz/wiki.git  

where personalgit comes from the HostName in the config file

Checking the remote now shows

git remote -v
origin  personalgit:qhrizz/wiki.git (fetch)
origin  personalgit:qhrizz/wiki.git (push)

Test to pull and it should work.


Clone a new repo using the key

ssh-add ~/.ssh/personal_git.key; git clone git@github.com:qhrizz/wiki.git

Or

git clone git@github.com:qhrizz/wiki.git --config core.sshCommand="ssh -i /Users/qhrizz/.ssh/personal_git.key"

And it should clone without any issues and then you can set the remote with

git remote set-url origin personalgit:qhrizz/wiki.git  
PreviousUninstall System extensionsNextPowershell Cheat sheet

Last updated 1 year ago

Was this helpful?