日々精進

新しく学んだことを書き留めていきます

git push -u origin masterするとpasswordを聞かれる

そしてgitユーザのpasswordを入力しても以下のようなメッセージが出てpushできない。

git@localhost's password:
fatal: '/user/test.git' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

これの原因はGitlabサーバの公開鍵の権限設定。以下を実行すると直った。

sudo chmod 644 /home/git/.ssh/authorized_keys
sudo chmod 755 /home/git/.ssh

公開鍵の権限がオープンすぎたのがだめだったっぽい。
これはわからん。。