SSH Connects As Wrong User

I am running a local install of GitLab-ee in a docker container. I have setup OmniAuth to use our campus’ CAS/SSO (saml) for authentication. I am able to login and other users are able to log in successfully. I am also able to add an SSH key to my user profile. I have successfully tested the ssh connection via: ssh -T The issue is that when the response banner displays it shows my user as “root” instead of “geigers” (which I would expect it to be). The “root” user is the default administrator user that was created on install of the docker container.

$ ssh -T
Welcome to GitLab, @root!

I am sure I have missed some configuration setting somewhere, but have not been able to find anything specific.

Below is the output from: gitlab-rake gitlab:env:info

System information
Proxy:		no
Current User:	git
Using RVM:	no
Ruby Version:	3.0.6p216
Gem Version:	3.4.13
Bundler Version:2.4.14
Rake Version:	13.0.6
Redis Version:	6.2.11
Sidekiq Version:6.5.7
Go Version:	unknown

GitLab information
Version:	16.1.2-ee
Revision:	0642e8c5c91
Directory:	/opt/gitlab/embedded/service/gitlab-rails
DB Adapter:	PostgreSQL
DB Version:	13.11
SSH Clone URL:
Elasticsearch:	no
Geo:		no
Using LDAP:	no
Using Omniauth:	yes
Omniauth Providers: saml

GitLab Shell
Version:	14.23.0
Repository storages:
- default: 	unix:/var/opt/gitlab/gitaly/gitaly.socket
GitLab Shell path:		/opt/gitlab/embedded/service/gitlab-shell

I think I finally figured this out. I removed all the keys and rebuilt the authorized_keys file (see: Maintenance Rake tasks | GitLab). After rebuilding I re-added my key now when I ssh I am seeing my user. It looks like I may have “munged” up the authorized_keys file while I was testing and experimenting.

1 Like