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@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@remote-server > > It always worked. > > Good luck, > > _______________________________________________ > gnhlug-discuss mailing list > gnhlug-discuss@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@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@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@mail.gnhlug.org http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/