I've setted up a git
private server on my desktop pc (OS ubuntu 21.04), and I whant to be able to work on those repos with my laptop or my desktop pc
- Already created
git
user (root
,my_user
,git
)
ssh-server
service on
ssh rsa keys
generated (laptop and desktop)
ssh/authorized_keys
configurated
- Able to access via
ssh
from my laptop
- Able to access via
ssh
from my desktop to my destkop withmy_user
- Able to
git push
from my laptop
But I have problems trying to git clone those repos on my destop pc
$ git clone git@Desktop:/home/git/repo.git
git@Desktop's password:
Instead of asking my password it ask the pasword for git user
Make sure to add
id_rsa.pub
to/home/git/.ssh/authorized_keys
I found out that I mistakenly add my
id_rsa.pub
frommy_user
to the wrong.ssh/authorized_keys
file by running cat comand./home/git/.ssh/authorized_keys
/home/my_user/.ssh/authorized_keys
I just have to add the missing key and it worked like a charm