Configuring SSH keys for different accounts on Github

Configuring SSH keys for different accounts on Github

Configuring SSH keys for different Github account the right way with the most comprehensive tutorial along with example code snippets.

SSH (Secured SHell) is a secure cryptographic network protocol for operating systems to let remotely access your hosting. It is used for managing networks, operating systems, and configurations. It is also inside many file transfer tools and configuration management tools. Most of the top corporation use SSH in almost every data centre. The modern web and computerised services are made cost-effective with the automation provided by SSH keys. This makes things more convenient and highly secured while handling. So, here is the blog about configuring SSH keys for multiple accounts in Github. 

Benefits of SSH keys

  1. Highly secured alternative username/password authorization.
  2. Being generated in public/private keys, SSH keys lets you share your public key with others and the private key is available on the machine only. 
  3. You can access your GitHub through SSH by sharing your public key.

Who Has Multiple SSH Keys?

One can say that almost every developer browsing around the web sphere have witnessed or encountered SSH in any way. SSH is used for connecting with remote servers that incorporated managing code with the help of GIT and by syncing it with remote repositories. You might be using one SSH key-pair for working on your company’s internal projects but you might be using a different key for accessing some client’s company projects in the same git account. In some cases, there are even possibilities of using different keys to access your own private server. 

It helps to manage multiple SSH keys for different GitHub, GitLab accounts so that you can access multiple accounts and projects, each with different credentials.

Create a folder inside .ssh folder in a new name[ eg. New ] and paste ssh key files inside the folder.

Create a config file inside the .ssh folder and update it with the below content. Self git accounts for your own SSH key and new for newly included one, differentiate with help of Host.

Self git account

Host github.com

HostName github.com

User git

IdentityFile ~/.ssh/id_rsa

New git account

Host github.com-New

HostName github.com

User git

IdentityFile ~/.ssh/New/id_rsa

github ssh

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

How to Compare Multiple GitHub Projects with Our GitHub Stats tool

In this article we are going to compare three most popular machine learning projects for you.

SSH into your AWS infrastructure using Github for RBAC

How do you let your employees access company AWS infrastructure using their Github credentials? How do you restrict parts of your infrastructure to certain Github teams? How do you configure SSH to use Github credentials? This blog post covers it all.

Invite friends to SSH into your laptop using their Github handle

We talk about a new feature in Teleconsole: you can turn any laptop into a secure and publicly accessible SSH server wich uses Github SSH keys for authentication.

Stay Safe on GitHub: Security Practices to Follow

As developers in this deeply interconnected community use open source code to build software, Github security should be a top priority. This is because extensive code re-use increases the risk of distributing vulnerabilities from one dependency or repository to another. As such, every contributor should focus on creating a secure development environment. Here are eight security practices that GitHub users can follow to stay safe and protect their code:

Stay Safe on GitHub: Security Practices to Follow

As developers in this deeply interconnected community use open source code to build software, Github security should be a top priority. This is because extensive code re-use increases the risk of distributing vulnerabilities from one dependency or repository to another. As such, every contributor should focus on creating a secure development environment. Here are eight security practices that GitHub users can follow to stay safe and protect their code: