Why does ssh connection to gitlab not work (while http push and clone work fine)?

前端 未结 4 2406
野的像风
野的像风 2021-02-20 11:48

I run a x86 raring ringtail on a old pc and having installed bitnami gitlab 5.3.

Here is my error msg when trying to push the first master branch in SSH mode:

         


        
4条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-20 12:31

    I needed to add my public key to the /home/git/repositories/.ssh/authorized_keys. The authoried_keys in /home/git/.ssh seems to not be used.

    1. Add your public key to authorized_keys

      cat id_rsa.pub >> /home/git/repositories/.ssh/authorized_keys
      
    2. Ensure git is the owner of the file

      chown git /home/git/repositories/.ssh/authorized_keys
      
    3. Ensure group is git

      chgrp git /home/git/repositories/.ssh/authorized_keys
      
    4. Set file mode bits

      chmod 600 /home/git/repositories/.ssh/authorized_keys
      

提交回复
热议问题