Reputation: 21
I need to access (clone) a private repository on GitHub that belongs to a developer whom I am unable to communicate with. I have been provided with both a public and a private key (I'm guessing they might be deploy keys for the specific repository?)
After running the following terminal command:
git clone [email protected]:theirusername/reponame.git
I receive the following error:
Cloning into 'reponame'...
ERROR: Repository not found.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
The developer also included the following notes in a README with the keys: Developer notes (replaced sensitive info with 'x's)
===============
"This SSH public/private keypair allows full access to the server.
DO NOT GIVE THESE FILES TO ANYONE THAT YOU DON'T WANT ACCESSING YOUR ENTIRE SERVER AND ASSOCIATED SERVICES.
- The SSH port is XXXXX.
- There is no passphrase on the keys.
- The keys allow access to two users: `xxx` (standard privs) and `xxx` (for sudo and su-ing to root)
- These keys also allow access to the GitHub repository: github.com/theirusername/reponame.git"
I have already tried adding the public key to my Github account (under settings --> SSH and GPG keys). This did not seem to help the issue.
I'm sure there is something fundamental I'm not grasping here. Do I need BOTH the public and private keys to access the repo? If so, where do I have to register each of them? Any help would be greatly appreciated.
Upvotes: 2
Views: 3071
Reputation: 1326366
You need to store the public and private key in your HOME (~/.ssh
)
You can then test the connection with ssh -T [email protected]
: if those keys are from another developer, it should display a welcome message with the other developer name (since the public key should be registered under his/her GitHub account)
If you have multiple keys, you will need an ~/.ssh/config file
, as I describe here.
Upvotes: 2