gitlab-shell is not invoked when I `ssh` to my server.
Created by: trusktr
So I'm wondering why I'm getting the common "fatal: Could not read from remote repository." error, and I've discovered that it's because the gitlab-shell
isn't being invoked when I try ssh or git commands.
I'm fairly certain that this is the case for a couple reasons.
- I've put the line
puts "hello"
at the top of gitlab-shell
and I don't see any "hello" message when I try git or ssh commands.
- I've checked
/var/log/auth.log
and it shows that I have successfully connected via ssh, then the connection immediately gets closed:
Feb 6 21:01:10 localhost sshd[9129]: Accepted publickey for git from 130.86.73.97 port 62704 ssh2: RSA xx:xx:xx:xx:xx:xx
Feb 6 21:01:10 localhost sshd[9129]: pam_unix(sshd:session): session opened for user git by (uid=0)
Feb 6 21:01:10 localhost systemd: pam_unix(systemd-user:session): session opened for user git by (uid=0)
Feb 6 21:01:10 localhost systemd-logind[2230]: New session 3515 of user git.
Feb 6 21:01:10 localhost sshd[9129]: pam_unix(sshd:session): session closed for user git
Feb 6 21:01:10 localhost systemd-logind[2230]: Removed session 3515.
So, as you can see, gitlab-shell
is not being executed. I've installed GitLab before, so I'm familiar with setting all the permissions and ownership. The git
user has full permissions to all the necessary files.
Running bin/check
as the git user (after logging in with su - git -s /bin/bash
) shows that everything is OK and should be working just fine.
I have not modified .ssh/authorized keys manually. It was all done through the GitLab web interface, and it looks like this (the RSA key shortened for simplicity):
command="/usr/share/gitlab-shell/bin/gitlab-shell key-6",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty ssh-rsa AAAAB3Nxxx68Q== Joe@LENOVO-PC
Any idea why gitlab-shell
doesn't seem to get executed, and thus I cannot use ssh?