setting up my own git server
Bruce Labitt
bruce.labitt at myfairpoint.net
Sun Oct 9 15:19:28 EDT 2022
On 10/9/22 3:00 PM, Bruce Labitt wrote:
> On 10/9/22 2:41 PM, Šarūnas wrote:
>> On 09/10/2022 14.32, Bruce Labitt wrote:
>>> I am trying to accomplish this and am running into a couple of
>>> problems. Following the instructions at:
>>> https://www.linuxfoundation.org/blog/blog/classic-sysadmin-how-to-run-your-own-git-server
>>>
>>> Specifically, the command $
>>>
>>> cat ~/.ssh/id_rsa.pub | sshgit at remote-server "mkdir -p ~/.ssh && cat
>>>>> ~/.ssh/authorized_keys"
>>> fails with the message bash: /home/git/.ssh/authorized_keys:
>>> Permission denied
>> I don't know about git server (probably just a host with SSH access?),
>> but copying your public key to remote host can be done with:
>>
>> ssh-copy-id -i ~/.ssh/id_rsa.pub git at remote-server
>>
>> It always worked.
>>
>> Good luck,
>>
>> _______________________________________________
>> gnhlug-discuss mailing list
>> gnhlug-discuss at mail.gnhlug.org
>> http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/
> I am getting permission denied. Here's the question. I am logged in as
> bruce on the remote, and pushing my id_rsa.pub to user git on the
> remote-server. Do I need to instead be user git on the remote, create
> ssh keys, and then push them to remote-server? When I created the git
> user on both computers, they have no sudoer privileges. When I did
> adduser, I forgot to use the -m flag, so there's no home/git on the
> remote. But there is a /home/git on the server.
>
> $ ssh-copy-id -i ~/.ssh/id_rsa.pub git at rpi4.local
> /usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed:
> "/home/bruce/.ssh/id_rsa.pub"
> /usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to
> filter out any that are already installed
> /usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you
> are prompted now it is to install the new keys
> git at rpi4.local's password:
> sh: 1: cannot create .ssh/authorized_keys: Permission denied
>
> This stuff always puzzles me. There's an obvious explanation for the
> failure, but beats me what it is.
> _______________________________________________
> gnhlug-discuss mailing list
> gnhlug-discuss at mail.gnhlug.org
> http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/
>
Strangely, it worked after a second time - after I deleted the empty
authorized_keys. Was able to ssh in to the git at remote-server using the
passphrase, and checked there was an entry in the authorized keys
corresponding to the remote computer.
Back to the git issue. At least there's some progress :)
More information about the gnhlug-discuss
mailing list