I'm trying to set up a git repo for a project and therefore I want to make use of ssh keys in order to not re-enter my password every time.
I stumbled over the possibility to let ssh do the copying work with
ssh-copy-id, however it does not seem to work out for me.
$ ssh-copy-id -i git@server /usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/c/Users/Me/.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@server's password: sh: 1: cannot create .ssh/authorized_keys: Permission denied
Edit: I solved the problem the following way:
- logged in root via su
- changed ownership of the authorized_keys file via
chown git /home/git/.ssh/authorized keysto git
- then logged git back in
- lastly changed the rw permission to 600 via
chmod 600 ~/.ssh/authorized keysand successfully copied the key over