Tomcat – Gerrit ssh key setup on windows server

gerritssh-keystomcatwindows-server-2008

I am attempting to configure google's 'Gerrit' code review web app on a Windows server 2008 virtual machine on our internal network.

We are using Apache Tomcat (6.0.36) to host the web app and have deployed the gerrit.war to tomcats webapp folder, setup the context.xml, web.xml etc for the web app correctly i believe.

However when i startup Tomcat using the $CATALINA_HOME/bin/startup.bat i get the following message in the tomcat logs:


*Dec 07, 2012 1:03:54 PM org.apache.catalina.core.StandardContext listenerStart

SEVERE: Exception sending context initialized event to listener instance of class >com.google.gerrit.httpd.WebAppInitializer
com.google.inject.CreationException: Guice creation errors:*

1) No SSH keys under C:\Gerrit\config\etc
while locating com.google.gerrit.sshd.HostKeyProvider
at com.google.gerrit.sshd.SshModule.configure(SshModule.java:90)


I have created a is_rsa.pub SSH key and placed it in the specified directory to no avail. I have been googling this for about a week now and can't seem to find any information about the file or format it is expecting… documentation on setting gerrit up on windows seems hard to come by!

Can anyone provide useful information about how to correctly configure a host SSH key in this context?

Best Answer

I have just figured this out. The problem was not with authentication as such, i didn't get to the client access stage, i have been struggling to configure the server side ssh key to be used for subsequent client authentication.

It seems gerrit is looking for the server side ssh key file to be named 'ssh_host_key' in the config/etc folder not 'id_rsa.pub' which is the original name that the ssh-keygen program generates for the key. I don't know if this is a general server side ssh host key configuration but this seems to work for me.

I can now run the Gerrit web app successfully and can now continue configuring the client side ssh keys/accounts for client access.

Thanks for the posts/comments