Return wrong username and permission when using SSH key
Summary
I am admin with highest permission in my gitlab and owner of every project but I cannot clone/pull/push code by using SSH keys.
When I run ssh -Tv git@gitlab.domain in my terminal, it returns
debug1: channel 0: new [client-session]
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug1: client_input_global_request: rtype hostkeys-00@openssh.com want_reply 0
debug1: Remote: Forced command.
debug1: Remote: Port forwarding disabled.
debug1: Remote: X11 forwarding disabled.
debug1: Remote: Agent forwarding disabled.
debug1: Remote: PTY allocation disabled.
debug1: Remote: Forced command.
debug1: Remote: Port forwarding disabled.
debug1: Remote: X11 forwarding disabled.
debug1: Remote: Agent forwarding disabled.
debug1: Remote: PTY allocation disabled.
debug1: Sending environment.
debug1: Sending env LANG = en_US.UTF-8
debug1: Sending env LC_CTYPE = en_US.UTF-8
Welcome to GitLab, Huey Le!
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: client_input_channel_req: channel 0 rtype eow@openssh.com reply 0
debug1: channel 0: free: client-session, nchannels 1
Transferred: sent 3348, received 3228 bytes, in 0.3 seconds
Bytes per second: sent 13068.4, received 12600.0
debug1: Exit status 0
You can see, it welcome another people who is a developer in my Gitlab server.
Therefore, when I clone a repo, I get
GitLab: The project you were looking for could not be found. fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
Noted
- Other member has got a their permission and only me encounter the problem.
- Before I got the problem, I try the article as below to try work with SSH keys via port 443. And now i can work with https without input username/ password.
https://about.gitlab.com/2016/02/18/gitlab-dot-com-now-supports-an-alternate-git-plus-ssh-port/
Edit ~/.ssh/config as below:
Host gitlab Hostname gitlab.domain User git Port 443 PreferredAuthentications publickey IdentityFile ~/.ssh/id_rsa IdentitiesOnly yes
After that, I comment out the config in ~/.ssh/config to work with SSH but It returns error as above.
I can do everything with Https :(
Results of GitLab environment info
Expand for output related to GitLab environment info
(For installations with omnibus-gitlab package run and paste the output of:
sudo gitlab-rake gitlab:env:info)System information System: Ubuntu 16.04 Current User: git Using RVM: no Ruby Version: 2.3.3p222 Gem Version: 2.6.6 Bundler Version:1.13.7 Rake Version: 10.5.0 Redis Version: 3.2.5 Git Version: 2.13.0 Sidekiq Version:5.0.0 Go Version: unknown
GitLab information Version: 9.4.3 Revision: b125d21 Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: postgresql URL: https://gitlab.domain.com HTTP Clone URL: https://gitlab.domain.com/some-group/some-project.git SSH Clone URL: git@gitlab.domain.com:some-group/some-project.git Using LDAP: no Using Omniauth: no
GitLab Shell Version: 5.3.1 Repository storage paths:
- default: /opt/gitlab/repositories Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks Git: /opt/gitlab/embedded/bin/git
Results of GitLab application Check
Expand for output related to the GitLab application check
(For installations with omnibus-gitlab package run and paste the output of:
sudo gitlab-rake gitlab:check SANITIZE=true) sudo gitlab-rake gitlab:check SANITIZE=trueChecking GitLab Shell ...
GitLab Shell version >= 5.3.1 ? ... OK (5.3.1) Repo base directory exists? default... yes Repo storage directories are symlinks? default... no Repo paths owned by git:root, or git:git? default... yes Repo paths access is drwxrws---? default... yes hooks directories in repos are links: ... 3/1 ... ok 3/3 ... ok 3/4 ... ok 3/5 ... ok 3/6 ... ok 3/7 ... ok 3/8 ... ok 3/9 ... ok 3/10 ... ok 3/11 ... ok 3/12 ... ok 5/13 ... ok 5/14 ... ok 5/15 ... ok 5/16 ... ok 5/17 ... ok 5/18 ... ok 3/19 ... ok 8/22 ... ok 3/23 ... ok 10/25 ... ok 7/26 ... ok 5/27 ... ok 23/28 ... ok 23/30 ... ok 3/31 ... ok 23/32 ... ok 24/33 ... ok 3/35 ... ok 3/36 ... ok 3/37 ... repository is empty 3/39 ... ok 3/40 ... ok 3/41 ... ok 31/42 ... ok 3/44 ... ok 3/46 ... ok 3/47 ... ok 3/48 ... ok 3/49 ... ok 3/50 ... ok 3/51 ... ok 3/52 ... ok 3/53 ... ok 3/54 ... ok 33/55 ... ok 3/56 ... ok 3/57 ... ok 35/58 ... ok 3/59 ... ok 3/60 ... repository is empty 24/61 ... repository is empty 3/62 ... ok Running /opt/gitlab/embedded/service/gitlab-shell/bin/check Check GitLab API access: OK Access to /mnt/nfs/gitlab-data/home/.ssh/authorized_keys: OK Send ping to redis server: OK gitlab-shell self-check successful
Checking GitLab Shell ... Finished
Checking Sidekiq ...
Running? ... yes Number of Sidekiq processes ... 1
Checking Sidekiq ... Finished
Checking Reply by email ...
Reply by email is disabled in config/gitlab.yml
Checking Reply by email ... Finished
Checking LDAP ...
LDAP is disabled in config/gitlab.yml
Checking LDAP ... Finished
Checking GitLab ...
Git configured correctly? ... yes Database config exists? ... yes All migrations up? ... yes Database contains orphaned GroupMembers? ... no GitLab config exists? ... yes GitLab config up to date? ... yes Log directory writable? ... yes Tmp directory writable? ... yes Uploads directory exists? ... yes Uploads directory has correct permissions? ... yes Uploads directory tmp has correct permissions? ... yes Init script exists? ... skipped (omnibus-gitlab has no init script) Init script up-to-date? ... skipped (omnibus-gitlab has no init script) Projects have namespace: ... 3/1 ... yes 3/3 ... yes 3/4 ... yes 3/5 ... yes 3/6 ... yes 3/7 ... yes 3/8 ... yes 3/9 ... yes 3/10 ... yes 3/11 ... yes 3/12 ... yes 5/13 ... yes 5/14 ... yes 5/15 ... yes 5/16 ... yes 5/17 ... yes 5/18 ... yes 3/19 ... yes 8/22 ... yes 3/23 ... yes 10/25 ... yes 7/26 ... yes 5/27 ... yes 23/28 ... yes 23/30 ... yes 3/31 ... yes 23/32 ... yes 24/33 ... yes 3/35 ... yes 3/36 ... yes 3/37 ... yes 3/39 ... yes 3/40 ... yes 3/41 ... yes 31/42 ... yes 3/44 ... yes 3/46 ... yes 3/47 ... yes 3/48 ... yes 3/49 ... yes 3/50 ... yes 3/51 ... yes 3/52 ... yes 3/53 ... yes 3/54 ... yes 33/55 ... yes 3/56 ... yes 3/57 ... yes 35/58 ... yes 3/59 ... yes 3/60 ... yes 24/61 ... yes 3/62 ... yes Redis version >= 2.8.0? ... yes Ruby version >= 2.3.3 ? ... yes (2.3.3) Git version >= 2.7.3 ? ... yes (2.13.0) Active users: ... 28
Checking GitLab ... Finished