How-To: Access GitHub with EZSSH
Overview - How to Access GitHub With SSH Certificates
If your organization protects its GitHub organization with SSH certificates, you use the EZSSH client to request a certificate and get just-in-time access to your code. One command gets you a short-lived certificate, and then you keep using git exactly as you do today.
Having trouble authenticating to your git repository? Check out our guide to troubleshoot EZSSH issues with GitHub.
Prerequisites for Accessing GitHub With EZSSH
- You have downloaded and installed the EZSSH client.
- Your EZSSH and GitHub administrators have connected EZSSH to your GitHub organization. This is done once per organization.
How to Access GitHub With EZSSH - Video Tutorial
Want to follow along with our video tutorial? Check out our video below where we walk you through how to access GitHub with EZSSH:
Step-by-Step Guide - How to Get a GitHub SSH Certificate With EZSSH
-
Open your favorite terminal and run:
ezssh git -
The first time, EZSSH asks you to sign in with your Entra ID account.
-
EZSSH confirms with the message
GitHub identity created successfully.
-
Start using your favorite git tool to commit your code!
EZSSH GitHub certificates expire after the number of hours your organization configured. You have to run ezssh git again each time your certificate expires, or you can run it automatically on every git command.
How to Send a Git Command Through EZSSH
To save you a step, EZSSH can send a command to git for you. Add -c (or --command) and the git command to ezssh git. For example, to pull:
ezssh git -c "pull"
EZSSH takes care of using your existing certificate or getting a new one, and then calls git pull in another window.
How to Auto-run ezssh git on Every Git Command
If you would rather not run ezssh git manually each time your certificate expires, you can have git itself call ezssh git before every SSH connection. This works on macOS, Linux, and WSL.
-
Create a wrapper script at
~/.config/git/ezssh-git-wrapped.sh(the path can vary) with the following contents:#!/bin/sh ezssh git > /dev/null exec ssh "$@" -
Make the script executable:
chmod +x ~/.config/git/ezssh-git-wrapped.sh -
Point git at the wrapper by adding this to your
~/.gitconfig:[core] sshCommand = ~/.config/git/ezssh-git-wrapped.sh
The wrapper script calls ezssh git and then hands off to ssh, so ezssh itself has to be on your $PATH.
How to Troubleshoot GitHub Access With EZSSH
If git still asks for a key or returns Permission denied (publickey), follow our guide to troubleshoot EZSSH issues with GitHub.