I set up GitLab and put my repository into it.
I made ssh key as follows and put public key to my GitLab profile. It seems ok.
ssh-keygen -t rsa -C "$your_email"
I can clone my repository via ssh. But I cannot push into it via ssh as follows.
root@192.168.141.136's password:
Counting objects: 6, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (4/4), 337 bytes | 0 bytes/s, done.
Total 4 (delta 1), reused 0 (delta 0)
remote: GitLab: No such user or key
To ssh://root@192.168.141.136/var/opt/gitlab/git-data/repositories/root/reponame.g
it
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'ssh://root@192.168.141.136/var/opt/gitlab/gi
t-data/repositories/root/reponame.git'
I checked GitHub and looked into source code and it is clear that my user or ssh key was not found. But it is strange because I clearly set both of them.
actor = if params[:key_id]
Key.find_by(id: params[:key_id])
elsif params[:user_id]
User.find_by(id: params[:user_id])
end
unless actor
return Gitlab::GitAccessStatus.new(false, 'No such user or key')
end