Skip to content

Instantly share code, notes, and snippets.

@RDS-007
Forked from Tamal/git-ssh-error-fix.sh
Created September 10, 2022 18:52

Revisions

  1. @Tamal Tamal revised this gist Dec 15, 2018. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions git-ssh-error-fix.sh
    Original file line number Diff line number Diff line change
    @@ -5,6 +5,7 @@ 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
    $ ssh -T -p 443 git@ssh.github.com
  2. @Tamal Tamal renamed this gist Dec 15, 2018. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  3. @Tamal Tamal renamed this gist Dec 15, 2018. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  4. @Tamal Tamal revised this gist Dec 15, 2018. No changes.
  5. @Tamal Tamal revised this gist Dec 15, 2018. 1 changed file with 0 additions and 5 deletions.
    5 changes: 0 additions & 5 deletions git-ssh-error.md
    Original file line number Diff line number Diff line change
    @@ -25,13 +25,8 @@ provide shell access.

    $ git clone git@github.com:xxxxxx/xxxxx.git my-awesome-proj
    Cloning into 'my-awesome-proj'...

    remote: Enumerating objects: 15, done.

    remote: Counting objects: 100% (15/15), done.

    remote: Compressing objects: 100% (14/14), done.

    remote: Total 15 (delta 0), reused 15 (delta 0), pack-reused 0

    Receiving objects: 100% (15/15), 22.90 KiB | 4.58 MiB/s, done.
  6. @Tamal Tamal revised this gist Dec 15, 2018. 1 changed file with 6 additions and 1 deletion.
    7 changes: 6 additions & 1 deletion git-ssh-error.md
    Original file line number Diff line number Diff line change
    @@ -25,8 +25,13 @@ provide shell access.

    $ git clone git@github.com:xxxxxx/xxxxx.git my-awesome-proj
    Cloning into 'my-awesome-proj'...

    remote: Enumerating objects: 15, done.

    remote: Counting objects: 100% (15/15), done.

    remote: Compressing objects: 100% (14/14), done.

    remote: Total 15 (delta 0), reused 15 (delta 0), pack-reused 0
    Receiving objects: 100% (15/15), 22.90 KiB | 4.58 MiB/s, done.

    Receiving objects: 100% (15/15), 22.90 KiB | 4.58 MiB/s, done.
  7. @Tamal Tamal revised this gist Dec 15, 2018. No changes.
  8. @Tamal Tamal created this gist Dec 15, 2018.
    32 changes: 32 additions & 0 deletions git-ssh-error.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,32 @@
    $ 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

    $ # but this might work
    $ ssh -T -p 443 git@ssh.github.com
    Hi xxxx! You've successfully authenticated, but GitHub does not provide shell access.

    $ # Override SSH settings

    $ vim ~/.ssh/config
    ```
    # Add section below to it
    Host github.com
    Hostname ssh.github.com
    Port 443
    ```
    $ ssh -T git@github.com
    Hi xxxxx! You've successfully authenticated, but GitHub does not
    provide shell access.

    $ git clone git@github.com:xxxxxx/xxxxx.git my-awesome-proj
    Cloning into 'my-awesome-proj'...
    remote: Enumerating objects: 15, done.
    remote: Counting objects: 100% (15/15), done.
    remote: Compressing objects: 100% (14/14), done.
    remote: Total 15 (delta 0), reused 15 (delta 0), pack-reused 0
    Receiving objects: 100% (15/15), 22.90 KiB | 4.58 MiB/s, done.