SSH connection closed as soon as I log in?

Hello again,

I was able to log in, I think, because I get the message “Welcome to GitLab, @KarlJenkinson!”. But then the session is immediately closed.

OpenSSH_8.1p1, LibreSSL 2.7.3
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 47: Applying options for *
debug1: /etc/ssh/ssh_config line 50: Applying options for
debug1: Connecting to port 22.
debug1: Connection established.
debug1: identity file /Users/karljenkinson/.ssh/gitlab_com_rsa type 0
debug1: identity file /Users/karljenkinson/.ssh/gitlab_com_rsa-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.1
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.9p1 Debian-10+deb10u2
debug1: match: OpenSSH_7.9p1 Debian-10+deb10u2 pat OpenSSH* compat 0x04000000
debug1: Authenticating to as ‘git’
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: MAC: compression: none
debug1: kex: client->server cipher: MAC: compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:HbW3g8zUjNSksFbqTiUWPWg2Bq1x8xdGUrliXFzSnUw
debug1: Host ‘’ is known and matches the ECDSA host key.
debug1: Found key in /Users/karljenkinson/.ssh/known_hosts:1
debug1: rekey out after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey in after 134217728 blocks
debug1: Will attempt key: /Users/karljenkinson/.ssh/gitlab_com_rsa RSA SHA256:
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Offering public key: /Users/karljenkinson/.ssh/gitlab_com_rsa RSA SHA256:
debug1: Server accepts key: /Users/karljenkinson/.ssh/gitlab_com_rsa RSA SHA256:
Enter passphrase for key ‘/Users/karljenkinson/.ssh/gitlab_com_rsa’:
debug1: Authentication succeeded (publickey).
Authenticated to ([2606:4700:90:0:f22e:fbec:5bed:a9b9]:22).
debug1: channel 0: new [client-session]
debug1: Requesting
debug1: Entering interactive session.
debug1: pledge: network
debug1: client_input_global_request: rtype want_reply 0
debug1: Remote: /authorized_keys %u %k:1: key options: command user-rc
debug1: Remote: /authorized_keys %u %k:1: key options: command user-rc
debug1: Sending environment.
debug1: Sending env LANG = en_US.UTF-8
Welcome to GitLab, @KarlJenkinson!
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: client_input_channel_req: channel 0 rtype reply 0
debug1: channel 0: free: client-session, nchannels 1
Transferred: sent 3112, received 2928 bytes, in 0.2 seconds
Bytes per second: sent 14054.2, received 13223.3
debug1: Exit status 0

Any ideas where to look now? When I google this, I only get results from people that have errors after they are logged in.


That is because it is supposed to do that. You don’t have console access to the gitlab server via You can only do git push/pull commands via SSH, nothing else outside of gitlab.

Aha! That explains it. The docs were telling me to do exactly that. I just realized that I have been kind of skipping around the docs instead of starting at the beginning.

Will I find all this in the docs if I am just patient and read? :grinning:

Thank you for your patience,