Organisation repo does not clone through SSH

Hi,

I have an organisation that has one repo inside of it. I’ve added a collaborator to my repo and to my organisation. They want to clone the repo using SSH. I have added their public SSH key to the repo settings under the deploy section in the repo settings. When they copy the SSH url from the repo page and run git clone with it in their ubuntu terminal. It says FATAL ERROR: Git repository cannot be found.

Any help would be great thanks

What happens if they do: ssh git@github.com?

Note that an ssh public key can only be assigned to a single account. If they’re already using that key to access their GitHub account, you can’t use that same key as a deploy key, they’d need a new key.

They’d probably also want to set up an ssh config for it…

jsoref@jsoref-mbp tmp.dymk5vxd % cat test.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDiT8INaXgKqho0mt2XLswk8qN4QAKIPje1UImU6TDpTrRyqy9VoFCactkzm8BA5yaL6QovraVy6MjjD6aC+Q5B3jPEldho4O1y+9l8iCSX7oSgsLdfceVtxTxfMij3wJfcyARWl8WdJOdE1nwp87ejfEeZ/py2VMtuOLoMoJTivJ/Hb8xh9G9kvF3CXZWY9Ck+WVud9YHnN0S0oNExE0OpmFeC5eTSSXEiWWFB0hJMhGMt4xA6yEMqx5SRk0yNRMoREu3l6cSCvhY15D3Em2PdJ2DThNYNPtM/bYcG8PhSCGjBb2GJ4NYdYbrDi7GJcwBnx2FCFfEZMjBbH5wRh7lMtvtgtgibURqPij0IaJjXu7psUqmQm9NB/3bsWgzCVbsq0soHsk0pZMLX3fjgaWQta0SbeS3mXOEzpctVA19b6H79sR6AuCoRXf4czZGObnzF8u3+JsZTkeWj1bsWtkk7rIXVvP4Sc1GyKWw03N8mGBWWGEcxCGyLDrPyFnVBaEU= jsoref@jsoref-mbp.local
jsoref@jsoref-mbp tmp.dymk5vxd % ssh -i test git@github.com
Hi jsoref/examples-testing! You've successfully authenticated, but GitHub does not provide shell access.
jsoref@jsoref-mbp tmp.dymk5vxd % ssh git@github.com
Hi jsoref! You've successfully authenticated, but GitHub does not provide shell access.

I added:

host alt-github
hostname github.com
user git
identityfile /Users/jsoref/test

to ~/.ssh/config

And then mv test{,.pub} ~/.ssh to move the keys over…

And then I can do:

$ git clone alt-github:jsoref/examples-testing
Cloning into 'examples-testing'...
remote: Enumerating objects: 820, done.
remote: Counting objects: 100% (144/144), done.
remote: Compressing objects: 100% (84/84), done.
remote: Total 820 (delta 77), reused 84 (delta 50), pack-reused 676
Receiving objects: 100% (820/820), 113.14 KiB | 1.85 MiB/s, done.
Resolving deltas: 100% (216/216), done.

Note that github assigns actions based on the user that added the ssh key, so their actions will be billed as you in various places (which will almost certainly be confusing).

Alternatively, you could properly invite them as a collaborator and then you wouldn’t need to micromanage their ssh key(s).

So I’ve added them as a collaborater. Do they just need to add their SSH key and to their own account settings? Or just to the deploy keys on the repo?

Yeah, they just need their public key to be in their account.

And they can test w/ ssh git@github.com, it should say hello. Once that works, things should just work.

If it doesn’t, I’d file a ticket to:

Odds are you’re a paying customer :slight_smile:

Thanks @jsoref :bowing_woman:t3: @mfirkins, don’t forget to mark the solution if this was resolved!