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@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 >> [email protected] >> 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 [email protected] > /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 > [email protected]'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 > [email protected] > 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@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 :) _______________________________________________ gnhlug-discuss mailing list [email protected] http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/
