Skip to content

Instantly share code, notes, and snippets.

View sp004's full-sized avatar
:octocat:

Souvik Pal sp004

:octocat:
  • India
View GitHub Profile
@Tamal
Tamal / git-ssh-error-fix.sh
Last active October 31, 2025 02:02
Solution for 'ssh: connect to host github.com port 22: Connection timed out' error
$ git clone git@github.com:xxxxx/xxxx.git my-awesome-proj
Cloning into 'my-awesome-proj'...
ssh: connect to host github.com port 22: Connection timed out
fatal: Could not read from remote repository.
$ # This should also timeout
$ ssh -T git@github.com
ssh: connect to host github.com port 22: Connection timed out
$ # but this might work
@oanhnn
oanhnn / using-multiple-github-accounts-with-ssh-keys.md
Last active October 31, 2025 17:04
Using multiple github accounts with ssh keys

Problem

I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).

Solution

Use ssh keys and define host aliases in ssh config file (each alias for an account).

How to?

  1. Generate ssh key pairs for accounts and add them to GitHub accounts.