How-To: Access GitHub with EZSSH
If you are having trouble authenticating to your git repository, make sure to check out our Troubleshooting git problems guide
Prerequisites
Tenant Prerequisites
Your tenant admin/GitHub admins must connect EZSSH to GitHub Enterprise before users are able to login to Git using EZSSH.
Video Version
Usage
- Go to your favorite terminal, and enter:
ezssh git
- The first time it will ask you to login with your Azure Active Directory Account
- You should get a “GitHub identity created successfully” message
- Start using your favorite Git Tool for committing your code!
EZSSH Git certificates are short lived (based on your organizations settings might last between 1 and 72 hours). You will have to run this command each time the certificate is expired.
Sending a command through EZSSH
EZSSH offers the option of sending a command to your git solution to make it easier to use. Just add a -c and the command to your EZSSH git command. For Example if you want to pull you can do:
ezssh git -c "pull"
EZSSH will talk care of using your existing certificate or getting a new one and then will call 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
Make sure ezssh itself is on your $PATH — the wrapper script just calls ezssh git and then hands off to ssh.