Skip to main content

Connect with SSH

Generate SSH Key

~/.ssh

Follow instructions at Generate a new SSH key.

$ ssh-keygen -t ed25519 -C "your_email@example.com"

Generating public/private ed25519 key pair.

Enter desired filename when prompted and avoid manually renaming files for successful authentication.

Authentication

To use SSH keys to connect to online Git repository service providers, e.g. GitHub, follow the official instructions to add your public key to your account.

Configure ssh-agent

Additional steps might be required before you can successfully connect; check your online Git repository service provider documentation for additional instructions.

To test if the configuration works and you can successfully get authenticated on GitHub, run the following command:

ssh -T git@github.com

Auto-launch ssh-agent

Mac OS

On Mac OS X, these default private key files are handled automatically; see Saving your passphrase in the keychain for more details.

Windows

OpenSSH Authentication Agent Service

Enable the service by setting the Startup Type to either Automatic or Manual. When the service is Disabled, you might receive the following error:

unable to start ssh-agent service, error :1058
Error connecting to agent: No such file or directory

SSH Server and Client

Install SSH Server and SSH Client Optional Features; follow Getting Started with OpenSSH for Windows for more details.

Auto-launching SSH Agent

Additional steps are needed to automate the process of launching the SSH agent, follow Auto-launching SSH Agent on Git for Windows for instructions.

Usage with Bash

If you are using bash shell either as standalone or part of your IDE, you can find a custom .bashrc script template here that you can use to load your SSH keys when running a new shell instance.

Add the script file to your system profile directory, typically at %USERPROFILE%\ or C:\Users\<username>.

Git provides a bash shell and can be downloaded here.