エラー内容
GitLab で push 時に以下のようなエラーが発生した。
$ git push -u origin master Permission denied (publickey,gssapi-keyex,gssapi-with-mic). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
公開鍵もSSHの設定も間違っていないはず...。
ログを見てみると以下のメッセージが出ていた。
# /var/log/secure User git not allowed because account is locked input_userauth_request: invalid user git
パスワードを設定していないユーザーで SSH ログインしようとするとこのようなエラーが出るみたい。
解決方法
パスワードを設定するか以下のようにすれば解決する。
# /etc/shadow git:!!:16569:::::: ↓ 変更する git:*:16569::::::