I am trying to setup gerrit, but I guess I am missing some configuration as I am unable to connect to gerrit sshd. This guide is what I am trying to follow. The web interface is opening up and I was able to register. However when I try ssh user@my.example.net -p 29418 I am getting a Connection refused. I have verified that gerrit is indeed running.
Gerrit is running behind nginx and these are the configuration I have so far:
Nginx config:
server {
server_name my.example.net;
location / {
proxy_pass http://127.0.0.1:8090;
proxy_set_header X-Forwarded-For $remote_addr;
include conf/proxy.conf;
auth_basic "Admin";
include conf/auth.conf;
}
}
Part of gerrit.config:
[auth]
type = HTTP
[sshd]
listenAddress = 127.0.0.1:29418
[httpd]
listenUrl = proxy-http://127.0.0.1:8090/
The firewall is indeed allowed to accept connections on port 29418
# iptables -L -n | grep 29418
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:29418
Thanks for your help
Nginx has no influence on Gerrit’s SSHd and you can’t (AFAIK) proxy them through it.
You’ve configured Gerrit to listen on localhost (
sshd.listenAddress = 127.0.0.1:29418), so you can’t connect from remote. Just drop that line and it will listen to all interfaces by default, I guess that’s what you want.You can verify that through
netstat -ntlp | grep 29418. It must show0.0.0.0:29418as listening address, not127.0.0.1:29418.