Reputation: 11
Is it possible to access repository having only public SSH key? The key content looks like
ssh-ed25519 <key> <username>
I've tried to put the .pub key into ~/.ssh folder but it didn't take effect.
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
If so, how to setup such connection on Ubuntu?
Upvotes: 1
Views: 224
Reputation: 1323045
That means that public key shall be stored on server side (the one I'm trying to connect), and client (which from I'm trying to connect) shall have private key, and there is no other way to use SSH?
No, there is not: that is how GitHub will authenticate you. It will use your public key associated to your profile.
So you need to copy the ~/id_ed25519.pub
content to your GitHub profile SSH settings.
The ~/id_ed25519
private key, being private, must remains on your computer.
So, to share a repo access I should provide to a teammate private key (and key pass), right?
Most certainly not, as the private key provided would not be... private.
Said teammate should generate their own private/public key, allowing GitHub to authenticate them.
Once that is done, you can invite your teammate as collaborator to your repository. Then they will have push access to the repository.
Upvotes: 2