Using Multiple SSH Keys for Access Different Git Accounts

At work, I use both my companies internal GitLab and my personal GitHub account.  This requires multiple ssh keys for accessing each respective account.

Under Linux, this requires a ~/.ssh/config file, with a similar setup to the following:


User jonathan
IdentityFile ~/.ssh/id_rsa_github

Host *
User jonathan
IdentityFile ~/.ssh/id_rsa


In the above, I have a specific key for my GitHub account and a default key which I use to service my company’s internal GitLab.  This behaviour overrides the settings in the default ssh_config file.  There are various other parameters configurable as required.

  • Port
  • Protocol
  • LocalForward


The man pages are very helpful in this regard.


Helpful Resources:


Tagged , ,

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Collaboration Engineer

All things Technology - Posts to save for when you need them

Gerry Keleghan's Blog

A Blog about Cisco Unified Communications


my personal journey to ccie collaboration

Striving for greatness

Thoughts on DevOps, emerging tech, and open source

Network Experts Blog

“Knowledge comes by eyes always open and working hands.”

SIP Adventures

A unified communications blog by Andrew Prokop

The Cloverhound Blog

Cloverhound Employees Talk Unified Communications and Contact Center


Fog navigator. Get out of the clouds. Down to earth solutions. @Warcop

Cisco Collab Engineering Tips

Michael White - CCIE #26626


Photography by Manos,


Thoughts and experiences of a Cisco Collaboration engineer after clearing the CCIE lab...

The Daily Post

The Art and Craft of Blogging

The Blog

The latest news on and the WordPress community.

%d bloggers like this: